Make desktop launcher for Matlab on Ubuntu

This brief tutorial will demonstrate how to make a .desktop file for Matlab on Ubuntu or another standard compliant desktop environment.
Open up a terminal, and run the following. In order for this to work, you will have needed to set up symbolic links during installation (see end if you didn’t).

sudo wget -O /usr/share/icons/matlab.png
sudo touch /usr/share/applications/matlab.desktop
sudo gedit /usr/share/applications/matlab.desktop

and paste the following into the document.

#!/usr/bin/env xdg-open
[Desktop Entry]
Name=MATLAB R2018a
Comment=Start MATLAB - The Language of Technical Computing
Exec=matlab -desktop

Save, and you should have a new desktop shortcut in your launcher. Comment with any issues or concerns following an update to Matlab and I will see if I can help.
Note you can change the “Name” field above for different versions.
You can also specify the direct path to the matlab executable as e.g. “Exec=/usr/local/MATLAB/R2018a/bin/matlab -desktop”.

If you did not set up symbolic links during installation you may be able to get away with running one additional command to make the above work:

sudo ln -s /usr/local/MATLAB/R2018a/bin/matlab /usr/bin/matlab

If needed, substitute R2018a for whatever Matlab version you are using.