help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

database-2.0.1 - this does not automatically load


From: richard
Subject: database-2.0.1 - this does not automatically load
Date: Tue, 19 Feb 2013 10:46:45 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

To date any commands run under database have completed 
successfully, however it appears that the package does 
not automatically load when octave starts. 

If I then run  
octave > pkg load database 
this does bring the package online, and it appears there 
is an option within the package to load automatically. 

Is this the expected behaviour? 

I have appended an example of use of the package as this 
may be useful to others attempting to use the database 
package

richard

############################################################## 
#read data from a database table (rome001) and publish a graph
 conn = pq_connect (setdbopts ("host", "localhost", "dbname", "rome", "user", 
"username", "password", "secret"));
 S = pq_exec_params (conn, "select year, l_pay, legion_pay, legions, Army_pay 
from rome001 order by year;");
 for j = 1:330 x(j) = S.data(j,1) ; endfor
 for j = 1:330 b(j) = S.data(j,2) ; endfor
 for j = 1:330 c(j) = S.data(j,5) ; endfor
 y1 = cell2mat(b);
 y2 = cell2mat(c);
 x1 = cell2mat(x);
 ax = plotyy (x1, y1, x1, y2, @plot);
 xlabel ("Year");
 ylabel (ax(1), "Legionaire pay pa");
 ylabel (ax(2), "Roman Army Costs pa");


reply via email to

[Prev in Thread] Current Thread [Next in Thread]