MATLAB: Do I receive “can’t open library: /usr/local​/lib/libXm​.2.dylib” when running Matlab 7.0 (R14)

MATLAB

When running the MATLAB startup script (matlab) from the $MATLAB/bin/mac directory in an xterm window on Mac OS X 10.3, I receive the following error:
dyld: ./matlab can't open library: /usr/local/lib/libXm.2.dylib (No
such file or directory, errno = 2)

Best Answer

This error is caused by running the MATLAB startup script (matlab) from the wrong directory ($MATLAB/bin/mac):
Instead, use the script that is located in the following directory:
$MATLAB/bin
where $MATLAB is the name of the directory where you installed MATLAB.