How do I make a desktop launcher for MATLAB in Linux?
Show older comments
I don’t want to have to open a terminal window every time I want to launch MATLAB on Linux. I tried to make a Gnome launcher, but it does not seem to work. The command I gave was:
/usr/local/bin/matlab &
I see the process running, but now windows appear. What am I doing wrong?
5 Comments
Royi Avital
on 27 Jul 2017
Is there a reason why Mathworks doesn't supply such Launcher with the installer?
Galen Lynch
on 17 Dec 2019
Edited: Galen Lynch
on 17 Dec 2019
With 1,737 views in the last month, this question is apparently still quite relevant. The lack of a desktop launcher for Gnome, which is about 10 lines of text, is a glaring omission on the part of Mathworks for such an expensive product.
Antonio Bono
on 18 Jan 2020
Edited: Antonio Bono
on 18 Jan 2020
I agree with Galen. It's very disappointing that Mathworks hasn't yet solved this issue...
Tim Darrah
on 12 May 2020
Couldn't have been said better...
Calin Bira
on 2 Mar 2022
try to run as such: /usr/local/bin/matlab -desktop
Accepted Answer
More Answers (17)
In your terminal, type sudo apt-get install matlab-support, press enter, and follow the instructions. It works for Ubuntu 16.0 LTE
38 Comments
Jonathan Kane
on 19 Dec 2016
I have Ubuntu 16.04LTS and executed 'sudo apt-get install matlab-support' and it didn't work. No Matlab icons.
BTW, I tried doing this through the App center first. It gave weird installation errors and didn't work. Then I tried following the instructions on https://help.ubuntu.com/community/MATLAB :
1. Get an icon:
sudo wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png
2. Get the launcher file:
sudo wget 'https://help.ubuntu.com/community/MATLAB?action=AttachFile&do=get&target=matlab-r2012a.desktop' -O /usr/share/applications/matlab.desktop)
That didn't work either.
Any suggestions? Could it be that I didn't enable the "make symbolic links" button when I installed Matlab?
José Hinostroza
on 6 Feb 2019
Edited: José Hinostroza
on 6 Feb 2019
These two steps worked as a charm for me in R2018a, I just had to copy the launcher to the desktop and change the name.
Robert Watson
on 15 Mar 2019
The matlab icon can also be found within the default install package at the following path
/usr/local/MATLAB/R2018b/bin/glnxa64/cef_resources/matlab_icon.png
Anderson English
on 25 Sep 2019
This solution works for Kali 5.2 KDE
Jean-Baptiste Talbot
on 13 May 2020
It worked well for me! Thank you!
Rayko Stantchev
on 22 Jul 2020
This also worked for me on MX linux 19
Igor
on 11 Aug 2020
Also worked for Linux Mint 20, thanks!
Alejandro Argueta
on 24 Sep 2020
Worked for Ubuntu 20.04!
Ahmad Asmandar
on 1 Nov 2020
its worked for me ubuntu 20.04 KDE kernel 5.4.0-52
I have 2018b installed and it had a 2018b icon. I installed 2019b but it had no desktop icon. After running "sudo apt-get install matlab-support", the 2018b icon is gone and the new "Matlab" icon doesn't launch either matlab versions. :-(
I hoped I could have both versions on my PC.
Yes, quite amazing that Matlab hasn't solved this problem for such an expensive tool.
I was able to get a 2018b icon back using Tucker McClure's approach. And also created an icon for 2019b using the same approach.
Mahmoud Ghorab
on 12 Dec 2020
Thanks!!
Syed Abdul Salam
on 13 Dec 2020
Thanks!
Worked for me on Ubuntu 20.04 LTS.
Ravi Kiran Aggadi
on 22 Jan 2021
the instruction works, perfectly.
Elham Ravanbakhsh
on 10 Feb 2021
Worked perfectly!
Kiss Máté
on 11 Feb 2021
Amazing! Thank you :)
Shai Feldfogel
on 3 Mar 2021
Worked for me! Thanks!
Cameron Klein
on 6 Mar 2021
Thanks!!! This worked
Andrea Barone
on 27 Mar 2021
Worked as charm on ubuntu 20.04 R2021a!
Bahadir Eryilmaz
on 19 Apr 2021
Thanks. It worked!!
Siddh Raman Pant
on 29 Apr 2021
This should be the accepted answer now.
Hayk Asatryan
on 5 May 2021
I confirm this, too. Thank you!
Mostafa Ahmed
on 5 Sep 2021
Working on Ubuntu 20.04 with matlab 2021a
LUCA GIROTTI
on 4 Nov 2021
Edited: LUCA GIROTTI
on 4 Nov 2021
Is there something similar with Arch?
Eduardo Salazar Hidalgo
on 20 Dec 2021
Working on Ubuntu 20.04 with matlab R2020b
Joshua Davis
on 12 May 2022
Edited: Joshua Davis
on 12 May 2022
ditto Eduardo
Working on Ubuntu 20.04 with matlab R2022a
Maxime Escande
on 14 Jun 2022
Working on Ubuntu 22.04 with Matlab R2022a, thanks a lot!
Debjyoti
on 19 Jun 2022
worked it like a spell! thanks.
chi-an lee
on 4 Jul 2022
work well on ubuntu 18.04 !
Cesar Banda
on 5 Aug 2022
Thank you!!
Simon Bachhuber
on 1 Oct 2022
How do we re-run this package if we upgrade from say 2021b to 2022b?
The launcher Icon is dead after upgrading.
"apt reinstall" does not work.
Hongbo Zhao
on 17 Oct 2022
it worked on ubuntu 22.04 with matlab R2022b!
Just need to find it in application and then right click, add to favorites
Tiago
on 30 Oct 2023
It works in Ubuntu 22.04 with Matlab R2023b too.
Zhu
on 18 Dec 2023
Works well on Ubuntu 20.04 with Matlba R2023b.
But how do yall configure the Gcc in the instructions?
Aitor
on 11 Sep 2024
It worked for me as well, in Matlab R2024a.
Wouter Verstraelen
on 30 Dec 2024
@Simon Bachhuber can specify the path of the specific installation version in /etc/matlab/debconf . Also spent some time removing linking files and reinstalling the whole thing; not sure how much of that was really necessary
Madhav Swaraj
on 27 Nov 2025
Edited: Madhav Swaraj
on 27 Nov 2025
thanks alot. worked for r2025b
Tucker McClure
on 26 Sep 2017
I seemed to have to do the least to get this to work, so I thought I'd share. I'm on Ubuntu 16.04 and installed with the defaults. I created ~/.local/share/applications/matlab_r2015a.desktop with the following contents:
[Desktop Entry]
Version=1.0
Type=Application
Name=MATLAB R2015a
Icon=matlab
Path=/home/tucker/dev
Exec=/usr/local/MATLAB/R2015a/bin/glnxa64/MATLAB -desktop -prefersoftwareopengl
Terminal=false
I then made it executable:
chmod +x matlab_r2015a.desktop
I then navigated to ~/.local/share/applications/ with the file browser (you may need to click View > Show Hidden Files to see .local) and dragged the matlab_r2015a.desktop file to the launcher bar. It showed up, I clicked on it, and it opened MATLAB.
7 Comments
Charles Ragan
on 3 Jan 2019
Worked for me too on creating a non-MATLAB application launcher on Ubuntu 18.04.
Ayush Soni
on 4 Jan 2019
What does this line signify?:
Path=/home/tucker/dev
Nelson Rodriguez
on 25 May 2020
Works! Thank you!
[Desktop Entry]
Type=Application
Name=MATLAB R2020a
Icon=/usr/local/MATLAB/R2020a/bin/glnxa64/cef_resources/matlab_icon.png
Path=/home/nelson
Exec=/usr/local/MATLAB/R2020a/bin/glnxa64/MATLAB -desktop -prefersoftwareopengl
Terminal=false
Martin Hanik
on 8 Jun 2020
Works! Thank you for sharing!
Cesar Julian Cerpa Diaz
on 8 Sep 2020
i used this way to fix my icon desktop on manajaro and that's it. thanks
Isidro Losada López
on 11 Nov 2020
In my case, I had problems with the graphics at some point. I found a solution somewhere (I really don't remember where, sorry) that not only solved my problem, but my graphics improved consederably. You just have to change a line in the matlab.desktop file:
Exec=env MESA_LOADER_DRIVER_OVERRIDE=i965 /usr/local/bin/matlab -desktop -prefersoftwareopengl
It worked for me in Ubuntu 18.04 LTS and now in Ubuntu 20.04 LTS!
Trevor Moon
on 8 Sep 2021
1. Create a linux .desktop file
touch ~/.local/share/applications/matlab.desktop
2. Add/copy relevant details for app launcher
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/path/to/matlab -desktop
Name=MATLAB RXXXXx
Icon=/path/to/icon
Comment=MATLAB
where /path/to/matlab is recommended to use usr/local/MATLAB/RXXXXx/bin/glnxa64/MATLAB and /path/to/icon is usr/local/MATLAB/RXXXXx/bin/glnxa64/cef_resources/matlab_icon.png
3. Make the file executable
chmod +x ~/.local/share/applications/matlab.desktop
4. Test the application launcher from the menu
From here, I had issues with the icons/descriptions to show. To fix this, I did
5. Move matlab.desktop to the shared applications folder
sudo mv ~/.local/share/applications/matlab.desktop /usr/share/applications
sudo is required since the root folder is protected
1 Comment
Arslan Yahya
on 24 Sep 2022
You can skip step 5., if you remember the '/' in the start of "/usr/local/MATLAB/RXXXXx/bin/glnxa64/cef_resources/matlab_icon.png"
Eric
on 25 Jun 2015
4 votes
Julian Zimmer
on 4 Nov 2016
Edited: Julian Zimmer
on 4 Nov 2016
The following trick worked for me:
Suppose <install>/MATLAB is the folder where you installed MATLAB and you are using zsh as your preferred shell:
1. download the MATLAB logo from Wikipedia and save it as <install>/MATLAB/logo.png
2. go to ~/bin and create the following shell script and call it matlab:
#!/usr/bin/zsh
<install>/MATLAB/bin/matlab -desktop &
3. make matlab shell script executable
chmod +x matlab
4. in /usr/local/applications, create matlab.desktop (you have to be root). If there are other people using the same system use the personal applications folder of your respective distribution
#!/usr/bin/zsh
[Desktop Entry]
Name=MATLAB
Exec= /home/<yourUsername>/bin/matlab
Icon=<install>/MATLAB/logo.png
Terminal=false
Type=Application
Categories=Development;Math;Science;Education;
This will add MATLAB to your Menu and Application Starter.
5. Copy the file matlab.desktop file to your Desktop folder
1 Comment
Steve Grobler
on 11 Feb 2017
a rather complicated solution to do something so simple!! Its no wonder Linux is not catching on :(
Taran Sachdeva
on 16 Mar 2017
The problem is actually with creating an icon in Ubuntu itself more than anything else. Solution from Julian is very close to the working icon solution however, the number of steps for the icon can be further reduced to only two steps (at least in Ubuntu 16.04.2).
1. Install gksudo: The reason you want to install this is because you will be turning off the terminal when you create the icon. This is a small graphical interface with a forced sudo backend (more on that later)
sudo apt-get install gksudo
2. create icon: open terminal and enter the following command
sudo gedit ~/.local/share/applications/matlab.desktop
a blank text editor will open up. In that editor paste the following set and save
[Desktop Entry]
Name=MATLAB
Type=Application
Exec=gksudo -S "<matlab location>/matlab -desktop"
Terminal=false
Icon=<icon location>
Comment=MATLAB
Categories=Development;IDE;
if you search for "MATLAB" now you will see an icon that can be dragged and dropped to the launcher (Ubuntu's equivilant for windows taskbar) or desktop.
the "<matlab location>" is a placeholder for where your matlab installation is stored. By default, it should be store in the /usr/local/MATLAB/.....
the "<icon location>" is a placeholder for where the matlab icon should be stored. It can be a .png,.ico or .xmp .
Comments on what is going on in the background:
1. The gksudo is running the sudo as its backend (https://linux.die.net/man/1/gksudo), if your linux box has a password, it will ask you for it when you click the icon you have created using the above instruction. Since we turned the terminal off (line 5) there will be no way for you to enter this password and matlab will keep crashing. gksudo provides a GUI interface that will allow the user to input his/her password.
2. matlab -desktop, forces matlab to run in desktop mode with the full matlab shell
2 Comments
gorilla3
on 20 Nov 2017
hi,
what is the file that we need to open in "usr/local/MATLAB/..." there are many files there and I don't know which to select
Mohsen Malayjerdi
on 16 Nov 2019
Hi, you need to address like this:
usr/local/MATLAB/R2019b/bin/matlab
but you should consider your version. The run file is on the bin folder
Thaddeus Song En Low
on 6 Dec 2017
A little bit late to the train, but an alternative that one can use, not only for matlab but for other scripts also, for those in Ubuntu.
1) Install "alacarte"
sudo apt-get install alacarte
2) Run alacarte and select "new item". Provide the command (ie. the matlab script) and name. You can also provide a logo by clicking on an image file. If you don't have a logo, just download one off the web.
You can now launch matlab without a terminal.
3 Comments
gorilla3
on 17 Dec 2017
Thank you very much, I tried but I get an error message during the installation:
E: invalid operation alacarte
gorilla3
on 17 Dec 2017
I managed to install it and it does launch but it crashes immediately.
Salma Omer
on 16 Jul 2020
sorry, but how can I run alacarte??
Rachel Allcock
on 28 Jun 2019
Edited: Rachel Allcock
on 28 Jun 2019
1 vote
Fairly straightforward using Xubuntu 18.04 (XFCE) using the menu edit function with the command path:
/usr/local/MATLAB/R2019a/bin/matlab
but the key is to check the "Run in Terminal" box otherwise it won't start. You'll see the Terminal run in the background but it launches the full desktop.
Zoltán Gál
on 19 Sep 2023
1 vote
Update for 2023:
Matlab R2023b Linux installer still does not create a shortcut which is annoying. However, when making one manually, Mint 21 Cinnamon offers a MatLab icon among the default icons. So it took literally 20 seconds to solve this minor annoyance in life. Also, the Mint icon is stylized and I think it fits better than the default, so it's a win for me.
James
on 12 Sep 2024
1 vote
13 years since the original post, MATLAB still does not automatically create a shortcut on Linux.
The mysterious -desktop flag requirement makes it even more irritating for the first time user (on Linux).
Mark
on 13 Apr 2018
0 votes
For Fedora, I made some packages packages:
https://copr.fedorainfracloud.org/coprs/hmaarrfk/useful_launchers/
You may also want to edit the file `/usr/local/MATLAB/R20XXX/resources/MATLAB/en/branding.xml`, the keys with IDE_TITLE so that it matches up with the icon correctly. I mostly didn't want to create many different packages everytime matlab changes their Title.
Result:
After launching it from the terminal, I clicked on its icon in the Launcher and then selected "Add to Dash". Voila! (on Ubuntu 16.04 LTS)
Qianqian Fang
on 17 Jan 2019
0 votes
The launcher approach does not work properly after I upgraded Ubuntu from 14.04 to 16.04. Basically, all envrionment variables defined in my ~/.bashrc are not inheriented in the MATLAB environment, making it impossible to link to libraries in the non-standard locations, such as libcudart etc.
This did work well in Ubuntu 14.04. Is this a known problem?
thanks
Thomas Friedrich
on 12 Aug 2020
For those struggeling with the environment variables / library location setup: The solution I am using now, is to use a bash script instead of the classical launcher. In this bash script the environment variables can be set prior to actually running matlab. For CUDA-10.0 the following would work:
#!/bin/bash
export CUDA_PATH=/usr/local/cuda-10.0
export CUDA_HOME=$CUDA_PATH
export CUDA_BIN_PATH=$CUDA_PATH/bin
export CUDA_LIB_PATH=$CUDA_PATH/lib64
# set PATH so it includes users private bin directories
PATH=$HOME/bin:$HOME/.local/bin:$PATH
PATH=/usr/bin:$PATH
PATH=$MATLAB_DIR:$PATH
PATH=$MATLAB_BIN:$PATH
PATH=$CUDA_BIN_PATH:$PATH
export PATH
LD_LIBRARY_PATH=$CUDA_LIB_PATH:$LD_LIBRARY_PATH
LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
/usr/local/MATLAB/R2019b/bin/glnxa64/MATLAB -desktop
Saving that script as 'run19b' in some place the OS is looking for binaries, one can then create a launcher like that:
[Desktop Entry]
Type=Application
Name=MATLAB R2019b
Icon=/usr/local/MATLAB/R2019b/bin/glnxa64/cef_resources/matlab_icon.png
Path=/home/thomas
Exec=run19b
Terminal=false
Obviously this approach can be extended to whatever library one would want to add and I guess it'll work on most Linux distros. I tested it on Mint 19 (Ubuntu 18.04).
Hernan Mojica
on 7 Oct 2021
Edited: Hernan Mojica
on 7 Oct 2021
Once time you have Matlab installed, for Ubuntu 21.04 follow nexts steps :
- Open a comand terminal.
- Create a desktop shorcout :
nano ~/Desktop/Matlab
- Copy-paste bellow lines:
[Desktop Entry]
Version=1.0
Type=Application
Name=MATLAB
Exec=/usr/local/MATLAB/R2021b/bin/./matlab
Icon=/usr/local/MATLAB/R2021b/resources/coreui/matlab/splash.png
Terminal=false
- Go to the path /Desktop in the terminal and copy-paste the following:
chmod +x Matlab
5 Comments
Rajat Bathla
on 17 Jan 2022
followed exactly for ubuntu 21 and did not work.
Vincent Plikat
on 2 Feb 2022
Followed it exactly for ubuntu 21 and it seemed to work, but when I wanted to open it, only the start MATLAB image was shown and then nothing happened.
I changed Terminal=true and it worked. Now an extra terminal is opened, but that does not bother me. It maybe actually nice, since error messages and warnings could help understand stuff
Calin Bira
on 2 Mar 2022
Edited: Calin Bira
on 2 Mar 2022
Make sure you call it with the -desktop parameter eg:
Exec=/usr/local/MATLAB/R2021b/bin/matlab -desktop
This parameter, did the trick for me in Linux
Piero Mana
on 18 Aug 2022
This was essential, thank you!
VC
on 27 Oct 2022
Following the guide here - https://wiki.archlinux.org/title/MATLAB#Desktop_entry
[Desktop Entry]
Type=Application
Terminal=false
MimeType=text/x-matlab
Exec=/usr/local/MATLAB/R20xyz/bin/matlab -desktop
Name=MATLAB
Icon=matlab
Categories=Development;Math;Science
Comment=Scientific computing environment
StartupNotify=true
This works for me (Fedora 36). The one suggest by @Hernan Mojica leads to a crash post splash screen.
li
on 8 Nov 2024
0 votes
在 matlab.desktop中添加 StartupWMClass=sun-awt-X11-XFramePeer 即可
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!