MATLAB: Matlab from command line

command line matlab

Can someone help me with this?
I am not able to use matlab from the command line. I have installed matlab r2017a on my mac. When I try to call it from the command line it returns this: The file /Users/XXXX/matlab does not exist.
Thanks

Best Answer

If you installed MATLAB R2017a in the usual place on the Mac, then you can add this to your ~/.bash_profile
alias matlab='/Applications/MATLAB_R2017a.app/bin/matlab -nojvm -nodesktop'
if you want to be able to run from the command line without the desktop GUI.