“This tutorial shows how to install Matlab on Linux. The tutorial was initially written in 2018 and updated in 2022.

As its official website says, Matlab is a very powerful application for analyzing data, developing algorithms, creating mathematical models, running simulations, generating code, and testing and verifying embedded systems, among other features.

We’ll learn how to install MatLab for free using the 30-day trial license in this tutorial. If you are a student, your educational institution probably already provides an unlimited free license; you can check if your institution has a MatLab license here.

All installation steps described in this document include screenshots, making it easy for every Linux user to follow them.”

Installing Matlab on Linux

To begin installing Matlab on Linux, you need to create an account at this link. But first, when accessing the Matlab website, you will be requested to choose your country, as shown in the screenshot below. Just select it to continue to the free license page.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-1.png" data-lazy- height="730" src="data:image/svg xml,” width=”1048″>

After being redirected to the Matlab account creation page, fill out the form, including your email address, location, description, and age question and press the Create button.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-2.png" data-lazy- height="541" src="data:image/svg xml,” width=”1017″>

Then you will be notified a confirmation email was sent to your email address.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-3.png" data-lazy- height="522" src="data:image/svg xml,” width=”926″>

Open the confirmation email and press the Verify email button or the link below it.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-4.png" data-lazy- height="473" src="data:image/svg xml,” width=”900″>

You will be redirected to an account creation page. Type your name, last name, and password and scroll down to the page. If you have a paid license, you can add the activation key or license below; this step is optional. If you are using a free 30-day trial, ignore the license field and scroll down.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-5.png" data-lazy- height="384" src="data:image/svg xml,” width=”457″>

Select the “I accept the Online Services Agreement” option and press the Create button.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-6.png" data-lazy- height="493" src="data:image/svg xml,” width=”575″>

In the Matlab trial screen, type your email address and select the dropdown menu asking about your matlab usage preferences.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-7.png" data-lazy- height="387" src="data:image/svg xml,” width=”844″>

At this step, you can choose as many options as you want to be included in your Matlab installation. Available options include the following.

  • MATLAB Essentials
  • Simulink Essentials
  • Biological Sciences
  • Deep Learning & Machine Learning
  • Image Processing and Computer Vision
  • Model-Based Systems Engineering
  • Power Electronics Control Design
  • Predictive Maintenance
  • Quantitative Finance and Risk Management
  • Robotics
  • Signal Processing
  • Simscape for Physical Modeling
  • Test and Measurement
  • Wireless Communications

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-8.png" data-lazy- height="382" src="data:image/svg xml,” width=”838″>

Once you type the email address and select the best option fitting your needs, press the Submit button.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-9.png" data-lazy- height="362" src="data:image/svg xml,” width=”775″>

After creating your account, you will be redirected to the Matlab online dashboard. As you can see, you can use Matlab’s online version, but if you are reading this tutorial, let’s continue with the Linux local installation.

Press the Install MATLAB button as indicated by the arrow in the following image.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-10.png" data-lazy- height="380" src="data:image/svg xml,” width=”866″>

When the download page shows up, press the Download button shown in the screenshot below.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-11.png" data-lazy- height="392" src="data:image/svg xml,” width=”754″>

After downloading Matlab, you need to create a dedicated directory for installation files. Usually, this directory is created under the /opt directory by running the command shown below.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-12.png" data-lazy- height="177" src="data:image/svg xml,” width=”1032″>

Move the Matlab .zip file you just downloaded to the /opt/matlab directory created in the previous step. The syntax is the following.

sudo mv matlab_R<Version>..zip /opt/matlab

Therefore to move the version I got, I run the following command.

sudo mv matlab_R2022a_glnxa64.zip /opt/matlab

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-13.png" data-lazy- height="185" src="data:image/svg xml,” width=”1240″>

Change your current directory for /opt/matlab.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-14.png" data-lazy- height="120" src="data:image/svg xml,” width=”680″>

Unzip matlab by executing the syntax below.

sudo unzip matlab_R<Version>..zip

In my case, to unzip Matlab’s last version, I execute the command shown in the following image.

sudo unzip matlab_R2022a_glnxa64.zip

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-15.png" data-lazy- height="498" src="data:image/svg xml,” width=”1262″>

If the Matlab Installer does not start, use the command below to fix the error. You can try to launch the installer as shown in the next step, and if it does not open the installer, then execute the command below.

To start Matlab installation, execute the command shown in the image below.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-16.png" data-lazy- height="183" src="data:image/svg xml,” width=”883″>

The first step requires you to type your email address and press the Next button.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-17.png" data-lazy- height="459" src="data:image/svg xml,” width=”762″>

The second step of the graphical installer will ask you to fill in the password, type it and press the Sing In button.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-18.png" data-lazy- height="332" src="data:image/svg xml,” width=”454″>

Tick the question “Do you accept the terms of the license agreement?” and press Next.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-19.png" data-lazy- height="455" src="data:image/svg xml,” width=”757″>

The licensing screen allows you to add a paid license. If you want to use a free trial, just press Next.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-20.png" data-lazy- height="452" src="data:image/svg xml,” width=”652″>

Confirm the user when requested by pressing Next.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-21.png" data-lazy- height="378" src="data:image/svg xml,” width=”517″>

I recommend you to leave the default destination directory; if you agree, then press Next.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-22.png" data-lazy- height="391" src="data:image/svg xml,” width=”600″>

You can include additional Matlab features depending on your needs. This step is a custom step; select any product you want and press Next.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-23.png" data-lazy- height="408" src="data:image/svg xml,” width=”601″>

Allow the installer to create symbolic links by pressing Next. This may prevent possible future problems.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-24.png" data-lazy- height="447" src="data:image/svg xml,” width=”669″>

To start Matlab files installation, press Begin Install.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-25.png" data-lazy- height="447" src="data:image/svg xml,” width=”668″>

The installation process will start. This only will last a few minutes.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-26.png" data-lazy- height="380" src="data:image/svg xml,” width=”656″>

When the installation process ends, press the Close button.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-27.png" data-lazy- height="428" src="data:image/svg xml,” width=”769″>

After completing the installation, you can launch matlab from the console by executing the command shown in the example below.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-28.png" data-lazy- height="550" src="data:image/svg xml,” width=”1084″>

As you can see, Matlab is ready to start working.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-29.png" data-lazy- height="685" src="data:image/svg xml,” width=”1155″>

How to Uninstall Matlab in Linux

Uninstalling Matlab is pretty simple as removing the installation root directory. First, check the Matlab root directory by running the command shown below.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-30.png" data-lazy- height="211" src="data:image/svg xml,” width=”796″>

If you selected the default installation directory, remove Matlab using rm.

sudo rm /usr/local/bin/matlab

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-31.png" data-lazy- height="99" src="data:image/svg xml,” width=”963″>

Finally, to remove the installer directory run:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/06/echo/Installing-Matlab-on-Linux-32.png" data-lazy- height="165" src="data:image/svg xml,” width=”903″>

That’s all about installing and uninstalling Matlab.

Conclusion

As you can see, installing Matlab on Linux is very simple and can be done by any Linux user independently of his expertise level. Matlab is an excellent choice for scientists of almost all fields and one of the most popular tools for it. Matlab alternatives include GNU Octave, Scilab,


AnyLogic and more. Linux always offers alternatives and varied options. Matlab also supports Microsoft Windows and Mac Os, which makes it great to share work between different platforms.

I hope you found this article useful to get started with Matlab. Keep following LinuxHint for more Linux tips and professional tutorials.