GNU Octave, an alternative to MATLAB

It has its own programming language designed to carry out numerical calculations and simulations.


GNU Octave, an alternative to MATLAB


GNU Octave is free software written with C++ intended for carrying out numerical calculations and simulations.

It is often used as an open source alternative to MATLAB, being compatible with the MATLAB programming language and providing a wide range of functionality for numerical analysis and computation. scientific.

It has several integrated tools for plotting and 2D/3D visualization. It is available for Windows, macOS, GNU/Linux and BSD.


Installation

To install GNU Octave you can use your operating system’s package manager or download the binary and run, or install, it manually.

Example for recent versions of Ubuntu:

sudo apt install octave

For other systems or distributions see the GNU Octave download page. In addition to being able to compile from scratch!


Usage

After installing, you can open octave graphically or via command line. When running just the command below, a subshell will be launched that will interpret the GNU Octave commands after typing it and pressing enter:

octave

If you want to use it graphically, just search for the name Octave on your system dashboard, or run it via the command line as well:

octave --gui

When opening for the first time it may ask for some configuration data such as those listed below: GNU Octave init config

Click on the image to open in a new tab and enlarge it!

GNU Octave open

The interface is very intuitive and you can use the tabs in the bottom right corner to choose between:

  • Command window - The graphical subshell
  • Documentation - Including examples
  • Variable editor
  • Editor

A basic example of use would be to create a graph that will display y as a function of x, using the Command Window or directly in the terminal subshell:

x = linspace(0, 2*pi, 100);
y = sin(x);
plot(x, y);

This will display the figure: GNU Octave plot example

And if it’s graphical: GNU Octave plot GUI


For more information visit GitHub repository, official website and wiki.



Share


YouTube channel

Subscribe


Marcos Oliveira

Marcos Oliveira

Software developer
https://github.com/terroo

Related articles