Matlab alternative Octave is an open-source special-purpose high-level level programming language. let’s see the commands to install Octave on Ubuntu 22.04 Jammy or 20.04 Focal LTS Linux.
Under GPL license Octave is available to use by anyone free of cost; it uses its own script language, which is very similar to Matlab and therefore makes switching particularly easy. This is a program package for the numerical solution of mathematical and scientific tasks as well as for general data analysis and visualization. Using it developers can also create a math program completely compatible with Matlab with free additional packages and add-ons. In this way, the data you have already created will not be lost. In particular, an Octave program can usually also be executed by MATLAB without changes.
Well, it is a command-line tool natively but also comes with a graphical user interface in the standard installation. It is available for Linux, Windows, and Mac OS.
The functionality of Octave is almost identical to the core functionality of MATLAB. Its GUI system includes:
- Octave command window
- Syntax editor with highlighting and code folding functionality
- Debugger support
- File Browser
- Workspace viewer
- Users can hide and move different elements of the GUI, to set them as per convenience such swap the positions of the workspace and File Browser.
- Documentation browser
Steps to install Octave GUI on Ubuntu 22.04 or 20.04 LTS
The given steps are not just limited to the 20.04 or 22.04, we can use them on Ubuntu 18.04, Debian, Linux Mint, POP!_OS, MX Linux, and other similar Linux.
1. Perform a system update
In order to make the system repo cache up to date and other packages installed on your system, run once the system update command:
sudo apt update
2. Command to install Octave on Ubuntu 22.04 | 20.04
The packages to install Octave programming languages are available in the default-based repository of Ubuntu Linux. Hence, we don’t need to add any third-party repo on our Linux system. Start the execution of the given command.
sudo apt install octave -y
3. Run this Matlab Alternative
As soon as the Octave installation is completed using the APT package manager, its GUI editor along with the command line, will be installed on your system. After that, we can start it with just one click from the Application launcher on Ubuntu.
4. GNU Octave Graphical Interface on Ubuntu 20.04 | 22.04
Finally, the graphical user interface will be on your system to start programming with Octave. The GUI elements available are I/O dialogs, a progress bar, and UI elements for plot windows.
5. Octave interpreter using Command line shell
Those who are not interested in the graphical user interface can go for the command line. Open a command terminal and then run –
You will have the Octave shell to start programming.
6. Let’s try to write some code to get an interactive output
You can also use GUI editor, here we are using command terminal.
Let’s write a simple syntax to get a visual output. Here we are assigning x, y, and z- a peak value of 30 and after that running a command to get a graphical plot for the same.
[x,y,z] = peaks(30); surfc(x,y,z)
Remove or Uninstall Octave
Well, maybe after some time you won’t require this programming language on our Debian base Linux system, then you can use the given command to completely uninstall it.
sudo apt remove octave
This was a simple way to get Octave programming language along with a graphical user interface on Ubuntu 22.04 or 20.04. If you want to know more and try out your syntax output live, then visit the official website page of this platform.