Octave 3.8 on Ubuntu 12.04

Here’s how to install GNU Octave 3.8 on Ubuntu 12.04 (also on Ubuntu 10.04):

Open Terminal and do:
1) sudo apt-add-repository ppa:octave/stable
2) sudo apt-get update
3) sudo apt-get install octave liboctave-dev

Note: if you have Octave 3.2 installed already, these commands will uninstall Octave 3.2 and install Octave 3.8.

To install packages, start Octave in sudo mode i.e. type in Terminal:
octave
and then you can install packages by typing in Octave:
pkg -verbose install -forge specfun
to install the specfun package, and so on.

To use the Octave packages you must type pkg load image to load the “image” package and so on.

You can list the loaded packages by typing in octave pkg list. The loaded packages have an asterisk next to their name.