MATLAB which is abbreviated as Matrix Laboratory is a programming language and numeric computing environment. It is used for solving mathematical problems and displaying the result graphically.
Optionally it provides a toolbox for symbolic computing and Simulink for multidomain simulation and model-based design for dynamic and embedded systems. It is developed by MathWorks.
In this article, I will discuss how to install MATLAB in Ubuntu Linux.
Prerequisites
You should have access to a user account with superuser permissions.
How to install MATLAB in Ubuntu
MATLAB is proprietary software so it is not available freely however you can use a trial version for 30 days. It comes in different licenses i.e. standard, home, education, or student.
Now follow the given steps to download and install the MATLAB on your Ubuntu system.
Download MATLAB for Linux
First, go to the official download page of MATLAB.
Here find and click on Download a Trial, on the next page it will ask you for your email id. Enter your email and verify your account by the link given in the mail sent to you.
Once your account is created it will bring you to the download page, here download MATLAB for Linux.
At the time of writing this article R2022a is the latest version of MATLAB available.
Extract the downloaded package
The downloaded package is in zip format so to install it first you need to extract this package.
Go to package downloaded location –
cd Downloads
Use the following command to install the unzip tool if it is not installed already –
sudo apt install unzip -y
Create a directory where all the files will be extracted –
mkdir matlab
Finally, use the given command to extract the package –
unzip -qq matlab*.zip -d matlab
Run the MATLAB installer
To run the MATLAB installer first move to the directory where you have extracted all files –
cd matlab
Next, use the following command to allow the root user to access the running x server –
xhost +SI:localuser:root
Finally, run the installer by using –
sudo ./install
Login and configure MATLAB
The above command for installing MATLAB will open the given window, log in with your MathWorks account.
Once you log in successfully first it will display the end-user license agreement here mark the yes and click on Next to proceed.
Next, select the license, you can enter the product activation key if you have otherwise you can proceed with a trial license for the individual as given in the image below, click on Next to move.
Choose a login name and click on Next.
Select the destination folder and click on Next.
Next, mark the products that you want to install, click on Next to proceed.
Mark the Create symbolic links to MATLAB scripts option to directly run MATLAB from the terminal.
Finally, click on Begin Install to start the installation process.
This will start the downloading process.
Open MATLAB in Ubuntu
Once the installation is completed you can launch the application by using the given command in your terminal –
matlab
You can see the user interface of MATLAB in the given image –
Create a MATLAB desktop shortcut
To create a MATLAB desktop shortcut open your terminal and run the following command –
nano ~/Desktop/Matlab.desktop
Now copy and paste the following into this file –
[Desktop Entry] Version=1.0 Type=Application Name=MATLAB Exec=/usr/local/MATLAB/R2022a/bin/./matlab Icon=/usr/local/MATLAB/R2022a/resources/coreui/matlab/splash.png Terminal=false
Save this file and right-click on the created file and click on Allow launching.
How to remove MATLAB from Ubuntu
If you want to remove MATLAB from your system then execute the given commands in your terminal –
sudo rm -r /usr/local/bin/matlab
sudo rm -r /usr/local/MATLAB
Conclusion
So now we hope you have successfully installed MATLAB on your system. Now if you have a query then write us in the comments below.