MATLAB Answers

How do I launch MATLAB on Linux?

4,163 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2010 年 11 月 29 日
編集済み: Gerrik Labra 2020 年 12 月 27 日 22:43
I've completed the installation and activation of MATLAB on a Linux computer. How do I launch the application?

採用された回答

MathWorks Support Team
MathWorks Support Team 2018 年 10 月 12 日
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 件のコメント

表示 13 件の古いコメント
Siddharth Kurkure
Siddharth Kurkure 2018 年 7 月 12 日
When I did that, I got ln: failed to create symbolic link '/usr/local/bin/matlab': File exists
Walter Roberson
Walter Roberson 2018 年 7 月 12 日
/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
Benjamin Stadler
Benjamin Stadler 2018 年 10 月 6 日
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/

サインインしてコメントする。

その他の回答 (5 件)

Mika Mäki
Mika Mäki 2019 年 5 月 8 日
編集済み: Mika Mäki 2019 年 5 月 8 日
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.

  8 件のコメント

表示 5 件の古いコメント
Igor
Igor 2020 年 8 月 11 日
It worked, thank you! The MATLAB icon is a different color for me on Linux Mint 20, but everything works great now.
Darcy de Asis
Darcy de Asis 2020 年 10 月 29 日
This worked thank you!
David Winthrop
David Winthrop 2020 年 11 月 4 日
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package matlab-support is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'matlab-support' has no installation candidate
Does not work...

サインインしてコメントする。


Marcos Rogério Fernandes
Marcos Rogério Fernandes 2017 年 11 月 1 日
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 件のコメント

Killian Gaudimont
Killian Gaudimont 2017 年 11 月 6 日
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?
gorilla3
gorilla3 2017 年 11 月 20 日
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.

サインインしてコメントする。


Diamond Fianka
Diamond Fianka 2017 年 5 月 5 日
thank, it works @ command promt enter matlab

  0 件のコメント

サインインしてコメントする。


Revanth Bhattaram
Revanth Bhattaram 2018 年 3 月 29 日
編集済み: MathWorks Support Team 2018 年 4 月 5 日
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 件のコメント

RITIKA  JAIN
RITIKA JAIN 2019 年 5 月 23 日
Thanks a lot. It worked !!

サインインしてコメントする。


Michael Levy
Michael Levy 2018 年 4 月 24 日
編集済み: Michael Levy 2018 年 4 月 24 日
Apparently, the first thing to do is to type the following 6 letters at the command prompt:
MATLAB

  2 件のコメント

Gerrik Labra
Gerrik Labra 2020 年 12 月 27 日 22:39
I tried with the latest verison, of Google linux beta, on google pixel book, but it doesn't show the graphics.
nnuilysis@penguin:~/Matlab$ ./install
terminate called after throwing an instance of 'std::runtime_error'
what(): Unable to launch the MATLABWindow application
Aborted (core dumped)
ennuilysis@penguin:~/Matlab$ matlab
-bash: matlab: command not found
ennuilysis@penguin:~/Matlab$ MATLAB
-bash: MATLAB: command not found
ennuilysis@penguin:~/Matlab$ cd
ennuilysis@penguin:~$ MATLAB
-bash: MATLAB: command not found
ennuilysis@penguin:~$ cd Matlab
ennuilysis@penguin:~/Matlab$ MATLAB
-bash: MATLAB: command not found
ennuilysis@penguin:~/Matlab$ Install
-bash: Install: command not found
ennuilysis@penguin:~/Matlab$ .install
-bash: .install: command not found
ennuilysis@penguin:~/Matlab$ .MATLAB
-bash: .MATLAB: command not found
ennuilysis@penguin:~/Matlab$ ennuilysis@penguin:~/Matlab$ sudo ./install
-bash: ennuilysis@penguin:~/Matlab$: No such file or directory
ennuilysis@penguin:~/Matlab$ No protocol specified
-bash: No: command not found
ennuilysis@penguin:~/Matlab$ terminate called after throwing an instance of '(anonymous namespace)::DisplayError'
-bash: terminate: command not found
ennuilysis@penguin:~/Matlab$ what(): No display available.
-bash: syntax error near unexpected token `:'
ennuilysis@penguin:~/Matlab$ Aborted
Gerrik Labra
Gerrik Labra 2020 年 12 月 27 日 22:39
furthermore, I was running MATLAB 2020b

サインインしてコメントする。

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by