johnathanmcclure
January 27th, 2010, 11:03 AM
I was using GNU Octave today to follow some MATLAB examples given in my university course on control systems.
One of the examples was to input a basic transfer function. When I tried to type in:
num1=[10]; den1=[1 2 5]; sys1=tf(num1, den1)An error was returned:
error: 'tf' undefined near line # column #I was frustrated because the online manual for Octave seems to clearly describe the "tf" function. Why was the tf function missing?
After searching for a while, I found this mailing list posting (https://www-old.cae.wisc.edu/pipermail/help-octave/2009-October/016389.html), where I discovered the stock installation of Octave in the Ubuntu repositories does not include control system functions.
To get these functions, you have to download and install them from Octave-Forge (http://octave.sourceforge.net/). There are a number of add-on packages available that are not in the default install.
In this case, I wanted the Controls packge, which is at http://octave.sourceforge.net/control/index.html.
Once I had the .tar.gz I went to the command line and did
$ sudo octave
octave:1> pkg install /foo/bar/downloadedpackage.tar.gz
The results using Octave as a direct replacement for MATLAB aren't perfect, but it's going much better with the Control package!
One of the examples was to input a basic transfer function. When I tried to type in:
num1=[10]; den1=[1 2 5]; sys1=tf(num1, den1)An error was returned:
error: 'tf' undefined near line # column #I was frustrated because the online manual for Octave seems to clearly describe the "tf" function. Why was the tf function missing?
After searching for a while, I found this mailing list posting (https://www-old.cae.wisc.edu/pipermail/help-octave/2009-October/016389.html), where I discovered the stock installation of Octave in the Ubuntu repositories does not include control system functions.
To get these functions, you have to download and install them from Octave-Forge (http://octave.sourceforge.net/). There are a number of add-on packages available that are not in the default install.
In this case, I wanted the Controls packge, which is at http://octave.sourceforge.net/control/index.html.
Once I had the .tar.gz I went to the command line and did
$ sudo octave
octave:1> pkg install /foo/bar/downloadedpackage.tar.gz
The results using Octave as a direct replacement for MATLAB aren't perfect, but it's going much better with the Control package!