Octave 3.6.4 on Ubuntu 12.04

Here’s how to install GNU Octave 3.6.4 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
4) sudo apt-get install liboctave-dev

Note: if you have Octave 3.2 installed already, these commands will uninstall Octave 3.2 and install Octave 3.6 on Ubuntu 12.04.

To install packages, start Octave in sudo mode i.e. type in Terminal:
sudo octave
and then you can install packages by typing in Octave:
pkg -verbose install -forge specfun
to install the specfun package, and so on.
DON’T FORGET to exit Octave after done installing packages (so that you’re not left running Octave in sudo privileges).

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.