octavepackages

Up: Tutorials

To install a package from downloaded file,

octave> pkg install PKGNAME-x.x.x.tar.gz

or to install it directly from octave forge site

octave> pkg install -forge PKGNAME

Installed packages are not ready to be used until loading them. To add a specific package to the path,

octave> pkg load PKGNAME

After loading, users can run all the functions provided by that package. To load all packages,

octave> pkg load all

To see which packages are installed,

octave> pkg list

To uninstall package,

octave> pkg uninstall PKGNAME

To update package,

octave> pkg update

To unload a specific package,

octave> pkg unload PKGNAME

The directory where octave packages are installed can be designated while configuring octave installation. The command below will install octave in subdirectories below PATH.

# ./configure --prefix=PATH

And packages are installed in OCTAVEPATH/share/octave/packages/. The default value of OCTAVEPATH is /usr/local/. You can check its directory even after installation either using

octave> OCTAVE_HOME

ans = /usr/local

or using

octave> octave_config_info('prefix')

ans = /usr/local

The command octave_config_info can give you more detailed configure information.

To check the package directory,

octave> pkg prefix

If you want to install a package in a different directory, set it before installation

Installation prefix: OCTAVEPATH/share/octave/packages

Architecture dependent prefix: OCTAVEPATH/lib/octave/packages

octave> pkg prefix NEW_LOCAL_DIRECTORY

The specific directory of a named package can also be found using

octave> pkg list PKGNAME

Octave packages can be found at http://octave.sourceforge.net/packages.php .

Up: Tutorials