How to create matlab icon or matlab.desktop file in Linux

I always install matlab to my linux system and every time i need to create matlab icon in linux. Matlab linux commands finding makes me crazy sometime because this question is asked all the time in the forums and there was no good answer for me. The matlab support generally recommends to install matlab-support in ubuntu market but still matlab desktop file is being needed because it doesn’t work [at least on me]. i should bring two or three good answers and wastes my half an hour to create matlab icon after every format. So, this article has steps for creating matlab.desktop file in Ubuntu 20.04.1 and POP!_OS.

Default installation path is used. if you install matlab to another path, you should change the exec location in the matlab.desktop file.

1- Open the terminal.

2- Download matlab icon into /usr/share/icons folder as matlab.png with the following code.

sudo wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png

3- Go to your home folder and see hidden files with pressing CTRL + H key combination. Go to ~/.local/share/application folder. Create a file as matlab.desktop and edit.

[Desktop Entry]
Version=1.0
Type=Application
Name=MATLAB R2020a
Icon=/usr/share/icons/matlab.png
Path=/home/oprocs
Exec=/usr/local/Polyspace/R2020a/bin/matlab -desktop -prefersoftwareopengl
Terminal=false

4. Edit path, exec and the name.

Save and exit. Make the file executable with right-click to the matlab.desktop file and click to options or open the terminal in destination file and execute the following code.

sudo chmod +x matlab.desktop

Now the icon must be created in Applications.

This Post Has 2 Comments

  1. KSH

    what do Version, Path and Exec mean, respectively?
    I have difficulty in editing matlab.desktop file.

    1. Ertu

      Sorry for late reply,
      Version is the version of the installation.
      Path is the home folder. psety is my user name here.
      Exec is the location of matlab execution file location.

      if you’ve installed a newer or older version, you need to update the exec and version name.

Leave a Reply