How to create launcher icon

Solution 1:

The lock to launcher is indeed not working for matlab. There is however a .desktop file that is part of the Matlab installation.

sudo ln /usr/share/app-install/desktop/matlab-support:matlab.desktop /usr/share/applications/matlab.desktop

You have to update a few things in this file (matlab.desktop):

[Desktop Entry]
X-AppInstall-Package=matlab-support
X-AppInstall-Popcon=3
X-AppInstall-Section=multiverse

Version=1.0
Type=Application
Terminal=false
Exec=matlab -desktop
Name=MATLAB
Icon=_usr_share_icons_hicolor_48x48_apps_matlab
Categories=Development;Math;Science
Comment=Scientific computing environment
StartupNotify=true
StartupWMClass=com-mathworks-util-PostVMInit

X-Ubuntu-Gettext-Domain=app-install-data

Give the icon an absolute file path by changing the icon path above to

Icon=/usr/share/app-install/icons/_usr_share_icons_hicolor_48x48_apps_matlab.png

And change:

Terminal=true

Now you should be able to lock the icon to the launcher as well as start matlab from there.

Solution 2:

For me this works perfectly ...

Open a terminal and then

1.download your own icon-

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

2.give your access permission

sudo touch /usr/share/applications/matlab.desktop

3.edit your .desktop file

sudo gedit /usr/share/applications/matlab.desktop

4.and paste the following into the document.

#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Icon=/usr/share/icons/matlab.png
Name=MATLAB R2014a
Comment=Start MATLAB - The Language of Technical Computing
Exec=matlab -desktop
Categories=Development;

that's it..! Save, and you should have a new desktop shortcut in your launcher

Solution 3:

To add an entry to the launcher and some other features, install the matlab-support package:

sudo apt-get install matlab-support

https://help.ubuntu.com/community/MATLAB

Solution 4:

In your matlab.desktop file, you need to specify that you want to execute in the desktop.

Your Exec= should look like this:

 Exec=/usr/local/MATLAB/R2013a/bin/matlab -desktop

Solution 5:

For Ubuntu 16.04 and MATLAB R2016b

Find your preferable picture in .png format and rename it matlab.png.

  1. Execute:

    sudo cp matlab.png /usr/share/pixmaps/
    

    The above command copies your icon to the appropriate folder.

  2. Execute:

    sudo gedit /usr/local/share/applications/matlab.desktop
    

    Then copy the following lines on matlab.desktop:

    [Desktop Entry]
    X-AppInstall-Package=matlab-support
    X-AppInstall-Popcon=10
    X-AppInstall-Section=multiverse
    Version=1.0
    Type=Application
    Terminal=false
    Exec=/usr/local/MATLAB/R2016b/bin/matlab -desktop
    Name=MATLAB
    Icon=/usr/share/pixmaps/matlab.png
    Categories=Development;Math;Science
    Comment=Scientific computing environment
    StartupNotify=true
    StartupWMClass=com-mathworks-util-PostVMInit
    X-Ubuntu-Gettext-Domain=app-install-data
    
  3. Go on Dash and type matlab.

  4. Pick the icon from Dash and move in onto Launcher.

Τέλος! The end!