Permission denied error when installing Matlab on Ubuntu

When installing Matlab on Linux, especially from an external/network drive, when you type

sudo ./install

you might get an error like:

/tmp/mathworks_/sys/java/jre/glnxa64/jre/bin/java: Permission denied

fix Matlab permission denied on install (steps for R2013a)

copy the whole matlab installation directory to your local home drive ~ e.g. to ~/mathworks_downloads

chmod +x ~/mathworks_downloads/R2013a/sys/java/jre/glnxa64/jre/bin/java
sudo ./install