Español – Home / Algorithms in Matlab or Octave
Install Octave
We'll detail some options for downloading and installing Octave for free on each operating system, although this isn't necessary if you're using it online. You can find more information about Octave on its website, including its HTML and PDF manual.
Another option is to use Matlab, but this software isn't free. However, you can use a free 30-day trial version. You can also use their help.
Windows
GNU Octave comes with version 10.2.0 and is the most recommended option if you have 64-bit Windows. Download octave-10.2.0-w64-installer.exe (509 MB), or the version with large data linear algebra octave-10.2.0-w64-64-installer.exe (507 MB), and run the file to install the program.
If you have 32-bit Windows (modern computers generally use 64-bit; you can check your version by following the help website), the best option is version 8.3.0. Download and install octave-8.3.0-w32-installer.exe (388 MB).
If you have a very old operating system, such as Windows XP, previous versions won't work, but you can use Octave 4.4.0 for 64-bit (205 MB) or Octave 4.4.0 for 32-bit (198 MB).
Octave-Forge includes older versions, in case you're short on space. You can download Octave 3.2.0 (45 MB) or Octave 3.6.4 (68 MB), although these versions don't include a windowed environment.
There's also a wiki detailing other options, and a video tutorial describing how to install Octave (and the symbolic package) on Windows.
Linux
Octave was originally developed for Linux and many distributions include it, although it's a good idea to make sure you have a recent version. Consult a wiki and a video tutorial.
Octave UPM incorporates version 3.6.2 in a windowed environment.
Android
Termux is a Linux-like terminal emulator for Android. Download and install this application from F-Droid or Google Play (with the Google Play version, access to the device is more secure, but it doesn't receive updates). To install Octave, run the following commands in Termux successively, accepting all:
pkg install wget
wget https://its-pointless.github.io/setup-pointless-repo.sh
sh setup-pointless-repo.sh
pkg install octave
There are two options for installing the features.
If you want to be able to access the features easily from other apps, grant Termux permission to access memory in your device's settings (in Settings > Apps > Termux > Permissions > Memory); unzip matlaboctave.zip, or the new testing version, and copy the files into a directory on your internal storage, naming it something like matlaboctave; and run the commands in Termux:
cd /storage/emulated/0/matlaboctave
octave
Another option, which doesn't require Termux to have permission to access memory, is to run the commands in Termux:
wget https://drive.google.com/uc?id=1ws7yYWuiwF0D8R6fhH4BY9sPJo62sgRw
unzip matlaboctave2.zip
octave
To get a graph as an image with the terminal in text mode, without having to install anything else, first run the command to create the graph and then run the command:
print image1.gif
The graph will be contained in the file image1.gif.
There is a wiki that describes more options.
Unix
See a wiki for Unix.
Mac OS
There is a wiki that details the download and installation, as well as a video tutorial for installation on Mac OS.
You can also use a virtual machine.
Installing the Functions in Matlab or Octave
After installing Octave or Matlab to make the functions available (and if you're not using Android):
Unzip matlaboctave.zip (or matlaboctave2.zip, the new version being tested) to a directory on your computer, such as c:\matlaboctave
Run the command in Matlab or Octave:
cd c:\matlaboctave
Installing and Loading the Symbolic Package in Octave
Octave offers some packages that expand the program's computational capabilities, although they are not required to use the functions in numerical mode. To use them in symbolic mode (and perform calculations with variable or exact precision), you do need to have the symbolic package installed and loaded.
Installing the Package
On Windows with Octave 6.4 or higher, you don't need to install the package, as it's included by default.
On Windows with Octave 4.2 or higher:
1. Download symbolic-win-py-bundle-2.9.0.tar.gz to a directory, for example c:\matlaboctave
2. Open Octave and run the commands:
cd c:\matlaboctave
pkg install symbolic-win-py-bundle-2.9.0.tar.gz
A video tutorial is available that describes the installation of Octave and the symbolic package on Windows.
On other operating systems, see the website for the symbolic package and also octsympy.
Loading the package
On any operating system, run the command every time you start Octave:
pkg load symbolic