How to Install MATLAB on Ubuntu 22.04

MATLAB is a computing and programming language platform used to create and develop algorithms and analyze data. In this article, we will learn how to install MATLAB on Ubuntu 22.04.

Downloading MATLAB

In order to download MATLAB, you must have a MATHWORKS account. If you don’t have it, go to the MATLAB website and create one.

Once your account is created, head to the Products section and click on Get MATLAB.

Clicking on Get MATLAB

In the next page, click on Install MATLAB.

The install Matlab button from the website

Then proceed to download MATLAB.

Downloading Matlab from official website

Alternativelly, if it makes it any easier for you, we can share the downloads page where you can download the installer directly, without following the steps mentioned above.

Preparing for Installation

Before proceeding with the steps to install MATLAB, we’re required to have a few things ready.

We need a file extractor and for the purpose of this article, we will use unzip. If you don’t have it installed, proceed to execute the following command:

$ sudo apt install unzip

We will also need a directory where we will extract the contents of the MATLAB archive:

$ cd ~/Downloads
$ mkdir matlab

We will create a destination directory for the installation:

$ sudo mkdir -p /usr/local/MATLAB/R2022b/

Now, we go to the directory where we downloaded the installer, in order to extract it:

$ cd ~/Downloads
$ unzip -d matlab

Next, head to the matlab directory, and then execute the installer.

$ cd matlab
$ sudo ./install

Installing MATLAB on Ubuntu

Step 1. Once we run the matlab installer, a login window will appear on the screen. Enter your name and username and then click on Sign In.

Email prompt on Matlab installer

Step 2. Accept the terms of license agreement then click next.

Accepting license agreement

Step 3. In the next window, activate or not, the activation key of your product.

Selecting license

Step 4. Next, confirm your user (use the account name on your system).

Confirming user for Matlab

Step 5. Select the destination directory, which we already created, where the application will be installed.

Selecting install path for Matlab

Step 6. Select the tools you need to use within the application.

Selecting Matlab products

Step 7. Create a symlink for MATLAB scripts.

Creating symlink

Step 8. And finally, a complete summary of information will be displayed in the window, which will be used to install the application. Click on Begin Install.

Confirm installation of Matlab

And that’s it. If you want to start the application from the terminal, you can execute the following command:

$ matlab &

Opening Matlab on Ubuntu

Creating a MATLAB Shortcut

I like to keep my desktop very nice and tidy but in case you want to create a shortcut, just follow these very simple steps:

Step 1. Create the shortcut path.

$ nano ~/Desktop/Matlab.desktop

Step 2. Copy and paste the next entry. Once done, use ‘ctrl + x’ to close it and then hit ‘y’ to confirm the changes.

[Desktop Entry]
Exec=/usr/local/MATLAB/R2022b/bin/matlab -desktop

Step 3. Finally, on your dekstop, right click on the MATLAB icon, and select ‘Allow Launching’.

Allow launching of Matlab shortcut

Removing MATLAB from Ubuntu

If for any reason you didn’t like MATLAB, you can remove it following the next commands:

$ sudo rm -r /usr/local/bin/matlab
$ sudo rm -r /usr/local/MATLAB

Leave a Comment

Your email address will not be published. Required fields are marked *