I'd love to run matlab from the terminal on my Macbook (running Lion), forgoing the standalone matlab interface. All the information I've found online suggests that the command is simply something along the lines of

$ matlab

followed by various tags (-nojvm, -nodesktop, -nosplash, etc.). When I run this from the terminal, I get

Js-MacBook-Pro:~ joehuchette$ matlab -nodesktop
-bash: matlab: command not found

I'm pretty inexperienced with this sort of thing, so any help would be much appreciated. Thanks!


Alternatively, put a symbolic link to the Matlab binary in your path:

sudo ln -s /Applications/MATLAB_RXXXx.app/bin/matlab /usr/local/bin

where XXXXx is the Matlab version.


Where is matlab located on your machine? The error you're getting indicates that it's not in the normal search path, so you'll need to either add the path:

export PATH=$PATH:/path/to/matlab

or use a full path to invoke matlab:

$ /path/to/matlab

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy