Ubuntu – How to create launcher icon

MATLAB

I recently installed Matlab R2013a and it is working fine, however the only way I can start it is by running /usr/local/MATLAB/R2013a/bin/matlab in the terminal. If I type in matlab it says command not found, and I can't seem to get an icon in the side-bar launcher. How can I make it so I can run from the command matlab or from a launcher?

Edit: I have created a link so I can launch it by typing matlab in the terminal. I still can't get the unity icon launcher working though. I managed to create an icon via a matlab.desktop file in /usr/share/applications. When I click it, it launches Matlab, but after the initial loading screen Matlab shuts down instead of launching the application. It works through the terminal though. My matlab.desktop file is:

[Desktop Entry]
Type=Application
Name=Matlab
Comment=Matlab R2013a
Icon=/usr/share/icons/Matlab.png
Exec=/usr/local/MATLAB/R2013a/bin/matlab
Categories=Office
Terminal=false`

Best Answer

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.

Related Question