The base Octave programme you download and install is good but there is plenty more functionality available via packages. These are add-ons that can be installed on top of Octave.
The homepage for Octave packages is part of the Octave GitHub site. Some examples of packages that are there:
For more info, see Octave for Debian systems on the Octave Wiki.
Firstly, you can obtain some additional features for Octave by installing liboctave-dev
from the terminal via the following:
$ sudo apt-get install liboctave-dev
Some packages rely on this being installed to work. Once done, you can install the Octave packages that are distributed by Debian/Ubuntu:
$ sudo apt-get install octave-control
$ sudo apt-get install octave-image
$ sudo apt-get install octave-io
$ sudo apt-get install octave-optim
$ sudo apt-get install octave-signal
$ sudo apt-get install octave-statistics
To install additional packages, you have two options to try:
Option 1: Installing from the Octave Forge
Run the following from the Octave prompt (either in the GUI or in the terminal after having opened Octave by running octave
):
octave:1> pkg install -forge {package_name}
where {package_name}
is the name of the package you want.
If you get the following error:
error: the following dependencies were unsatisfied:
Then the packages listed under this message need to be installed first before you can install the package you want to.
If you get this error:
error: pkg: please install the Debian package "liboctave-dev" to get the mkoctfile command
You need liboctave-dev
which, as mentioned above, you can install from the terminal with:
$ sudo apt-get install liboctave-dev
Option 2: Installing from your local machine
.tar.gz
extension) from the Octave Packages page/home/{your_username}/octave/
)octave:1> pkg install ~/octave/{package_name}.tar.gz
where {package_name}
is the filename of the tarball you downloaded, eg fileio-1.2.2
for the fileio package.
For the image-acquisition package you might first need to install FLTK (Fast Light Toolkit):
.tar.gz
file) from the FLTK Download pagecd ~/Downloads/fltk-1.3.8
sudo make install
sudo apt-get install libv4l-dev
.tar.gz
extension) from the Octave Packages pageoctave:1> pkg install C:/{package_name}.tar.gz
where {package_name}
is the filename of the tarball you downloaded, eg fileio-1.2.2
for the fileio package.
.tar.gz
extension) from the Octave Packages page/Users/{your_username}/
)octave
) and run the following in the command-line prompt:octave:1> pkg install {package_name}.tar.gz
where {package_name}
is the filename of the tarball you downloaded, eg fileio-1.2.2
for the fileio package.
Once you’re finished installing packages you can open Octave (again, either the GUI or in a CLI by running octave
) and run the following from the prompt:
octave:1> pkg list
This will display all the packages that have been installed and your new one(s) should be there.
Remember, once you’ve installed a package you still need to load it at the start of your script file before you can use it:
pkg load {package_name}
This should result in no message appearing. If the package hasn’t been installed properly or if there’s some mix-up with regards to which instance of Octave you are running it will say:
error: package {package_name} is not installed
error: called from
load_packages at line 47 column 7
pkg at line 588 column 7
Try re-installing the package and double-check which version of Octave you are using (octave --version
) and where it is installed (which octave
). It should be consistent: use the same instance of Octave to install and then use packages.