MATLAB Answers

How do I launch MATLAB on Linux?

5,137 views (last 30 days)
I've completed the installation and activation of MATLAB on a Linux computer. How do I launch the application?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 12 Oct 2018
MATLAB must be launched from the command line on Linux.
If you completed installation as root user, you may have had the option to install symbolic links to MATLAB in a folder on your system path. If you selected to install these links you can launch MATLAB from the command line, regardless of current working directory, by typing the command:
user@host$> matlab
If this does not work, or if you did not install the symbolic links during installation, you must launch MATLAB by specifying the full path to the MATLAB start script:
user@host$> cd $MATLABROOT/bin
where $MATLABROOT is the full path to your MATLAB installation directory, ex:
/usr/local/matlab/R2009b
then launch MATLAB using the following command:
user@host$> ./matlab
See the Documentation for additional information about starting MATLAB on Linux:
https://www.mathworks.com/help/matlab/matlab_env/start-matlab-on-linux-platforms.html
  16 Comments
Benjamin Stadler
Benjamin Stadler on 6 Oct 2018
If you're tiered of typing the entire path each time, you can simply add the matlab bin to your PATH variable as described here: https://askubuntu.com/questions/60218/how-to-add-a-directory-to-the-path
Note: The bin is located for me (Ubuntu 18.04, default installation) under
/usr/local/MATLAB/R2018b/bin/

Sign in to comment.

More Answers (6)

Mika Mäki
Mika Mäki on 8 May 2019
Edited: Mika Mäki on 8 May 2019
For Ubuntu (and its variants) there is the package matlab-support, which creates a shortcut for MATLAB in the launcher and applies a few bugfixes created by the community. You can install it with
sudo apt install matlab-support
You might also want to have a look at the Matlab page of official Ubuntu documentation and this thread.
  13 Comments
Walter Roberson
Walter Roberson on 14 Sep 2021 at 9:41
dpkg is used to install things.
You might need to sudo whatever you were doing, once, to allow it to install whatever it is trying to install.

Sign in to comment.


Marcos Rogério Fernandes
You can also make a shortcut (at least on Ubuntu) using gnome-panel like that:
sudo apt-get install gnome-panel (only if you don't already has installed)
sudo gnome-desktop-item-edit /usr/share/applications/ --create-new
So, into window that will appear for you, set the properties like below:
And then, will be in your applications menu a icon like that:
That way, you can run the Matlab direct from menu, also can add to dock.
  4 Comments
Carlos De Castro
Carlos De Castro on 26 Feb 2021
Thank you very much, this worked perfectly, I love you!

Sign in to comment.


Ish Jain
Ish Jain on 7 Apr 2021
To create a shortcut for matlab in Linux Ubuntu:
1. Open bashrc file located in ~/.bashrc in your favourite editer, e.g. vim
$ vim ~/.bashrc
2. Add matlab alias (copy the line towards the end of bashrc file)
alias matlab="/usr/local/MATLAB/R2021a/bin/matlab"
Make sure to use the correct path based on Matlab version
3. Source the bashrc file
$ source ~/.bashrc
4. Now to open matlab, just type on terminal
$ matlab

Revanth Bhattaram
Revanth Bhattaram on 29 Mar 2018
Edited: MathWorks Support Team on 5 Apr 2018
Step 1. go to terminal and type : matlab if it don"t work and
Step 2a: user@host$> cd <your installation path>/bin where <your installation path> is your installation directory Step 2b: user@host/<your installation path> /bin $> ./matlab
if it works then you can create a path in bash.bashrc file found in /etc folder open it using gksudo or any other editor as sudo, paste export PATH=$PATH:<your installation path> for example export PATH=$PATH:/usr/local/MATLAB/R2017b/bin/
save and exit. now if you enter matlab in terminal, it should launch.
  1 Comment
RITIKA  JAIN
RITIKA JAIN on 23 May 2019
Thanks a lot. It worked !!

Sign in to comment.


Diamond Fianka
Diamond Fianka on 5 May 2017
thank, it works @ command promt enter matlab

Michael Levy
Michael Levy on 24 Apr 2018
Edited: Michael Levy on 24 Apr 2018
Apparently, the first thing to do is to type the following 6 letters at the command prompt:
MATLAB
  2 Comments
Gerrik Labra
Gerrik Labra on 27 Dec 2020
furthermore, I was running MATLAB 2020b

Sign in to comment.

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!