Installed matlab on WS2 in /usr/local/matlab.
At first when I ran it the following error came up:
/usr/local/matlab/bin/glnxa64/MATLAB: error while loading shared libraries: /usr/local/matlab/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/libtbbmalloc.so.2: cannot restore segment prot after reloc: Permission denied
This is because of a problem with SELinux. Turning SELinux off using /usr/sbin/setenforce 0 allows matlab to run, confirming that this is the problem. Following the advice on this page:
I executed the following commands to get it working with SELinux on.
setsebool -P allow_execheap=1
chcon -t texrel_shlib_t /usr/local/matlab/bin/glnxa64/*.so*
chcon -t texrel_shlib_t /usr/local/matlab/sys/java/jre/glnxa64/jre/lib/amd64/*.so
It all seems to be happy now.