Reputation:
i'm doing a program in octave in which i got
t=0:.0002:20;
Gs=tf(100,[1 10])
u1=sin(t);
y1=lsim(Gs,u1,t);
plot(t,9.95*sin(t-0.1),’r’,t,y1,’b’)
However when i write Gs=tf(100,[1 10]) in the command window it appears "warning: the 'tf' function belongs to the control package from Octave Forge which you have installed but not loaded. To load the package, run 'pkg load control' from the Octave prompt." How can i load this package? I trully can't understand it... enter image description here
When i load it it appears:
pkg load control warning: addpath: C:\Octave\OCTAVE~1.0\mingw64\share\octave\packages\control-3.2.0: No such file or d irectory warning: called from load_packages_and_dependencies at line 48 column 5 load_packages at line 47 column 3 pkg at line 461 column 7
t=0:.0002:20; Gs=tf(100,[1 10]) error: could not find any INDEX file in directory C:\Octave\OCTAVE~1.0\mingw64\share\octave\packages
control-3.2.0, try 'pkg rebuild all' to generate missing INDEX files error: called from describe>parse_pkg_idx at line 94 column 5 describe at line 59 column 40 pkg at line 555 column 43 unimplemented>check_package at line 540 column 15 unimplemented at line 127 column 11
Upvotes: 2
Views: 5765
Reputation: 22225
In the octave terminal, type
pkg load control
To load the control package. If you do not already have the control package installed, you need to install it. You can do so directly from Octave Forge by typing
pkg install -forge control
Note that this will install this package in your predefined 'prefix'. You can find where that is by typing
pkg prefix
If you're not sure if you have the control
package installed, you can check the list of already installed packages by typing
pkg list
Type help pkg
to see more details about how octave's package manager works.
In any case, the tf
function belongs to the control
package, and like all packages, you need to load it before you can use its functions.
Having said this, even after loading the control package, your above code doesn't work. It seems like you're calling the tf
function using the wrong format.
Upvotes: 3