MATLAB Answers

5

How do I launch MATLAB on Linux?

I've completed the installation and activation of MATLAB on a Linux computer. How do I launch the application?

Tags

No tags entered yet.

Products

5 Answers

Answer by MathWorks Support Team on 12 Oct 2018
 Accepted Answer

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

When I did that, I got ln: failed to create symbolic link '/usr/local/bin/matlab': File exists
/usr/local/bin/matlab might already exist on Linux, as Linux has an option to create the symbolic links.
Either way, if it exists, then you might need to update it if it is referring to an older version of MATLAB.
ls -ld /usr/local/bin/matlab
If the output starts with 'd' then it is a directory and should not be removed without further investigation. If it starts with '-' then it is an ordinary file and should not be removed without further investigation. If it starts with 's' then it is a symbolic link, and the ls output will show you want it is currently linked to; in this case to update it
sudo rm /usr/local/bin/matlab
followed by the sudo ln
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.



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.

  2 Comments

I just downloaded matlab 2017b while there is the 2017a version on my computer (version I do not own the licence). By default the commande "matlab" on the terminal try to open the 2017a version and failed, even after I did what you said.
However if I choose the type "Application" instead of "Application in Terminal" it works great and I thank you.
Do you know what can I do to change the default settings of the commande "matlab" in the terminal though so that I can lauch matlab 2017b instead of 2017a from the terminal?
hi,
I tried implementing your solutions but it's still not working. What's the full text you input in "command"?
Also, I get this message in the terminal:
Gtk dialog mapped without a transient parent. This is discouraged
Ps. I have ubuntu 16.04 and am trying to run Matlab2017b.

Sign in to comment.


Answer by Diamond Fianka on 5 May 2017

thank, it works @ command promt enter matlab

  0 Comments

Sign in to comment.


Answer by Revanth Bhattaram on 29 Mar 2018
Edited by 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.

  0 Comments

Sign in to comment.


Answer by Michael Levy on 24 Apr 2018
Edited by Michael Levy on 24 Apr 2018

Apparently, the first thing to do is to type the following 6 letters at the command prompt:
MATLAB

  0 Comments

Sign in to comment.