This happens to be a new problem because I was able to run MATLAB on the shell until today. I didn't install or update it or anything of that sort, but now I am unable run matlab in the sell. It tells me:

user~ $ matlab bash: matlab: command not found

this seems weird to me.

The solution that I have tried is adding the MATLAB binaries to path. So I did:


where /Applications/MATLAB_R2015a.app is the path returned by matlabroot matlab command from the GUI. I tried this but as a no surprise, it didn't work, I still can't add the MATLAB binaries to my path. How does one find the MATLAB binaries location in my system? Even if I find them, is it advised to just manually add it to my path? I also restarted my computer (OS X) but that did not work either. Any advice how to solve the issue? Re-install MATLAB?

  • 1
    Try PATH="$PATH":"/Applications/MATLAB_R2015a.app/bin" Feb 1, 2016 at 19:38

1 Answer 1


Try finding the location of your matlab binary using command:

find / -name matlab 

Please note, larger the disk space you have, longer this command will run. If the binary is still on your system, you should get the actual location. Since I am not familiar with matlabroot command or any other command given to you by the application, I am not sure how trustable they are.

Also, I noticed you ran the matlabroot command without a path in the prefix. Which is telling me that your matlab binaries are searchable in the PATH. Which makes me think someone accidentally or knowingly deleted/moved the matlab binary

  • I don't understand the logic of your last paragraph. Why does that make you think it was moved? Btw, I did run the command you suggested and the amount of folders suggested are ridiculously large. Maybe I am better of just re-installing matlab. Feb 1, 2016 at 18:34
  • First off run the command as such find / -name matlab > /tmp/locations and edit this /tmp/locations file and search for matlab in it, using your favorite text editor. Secondly, why I believe it is moved, because, generally all executable files are placed in the same directory for a given application, like /opt/insert-application-name/bin etc. My assumption is, you matlab binary and matlabroot binary were in the same directory at one time. This is an educated guess though. It might not hold true. Hence the assumption part.
    – MelBurslan
    Feb 1, 2016 at 18:38
  • matlabroot isn't a binary program - it's a function within matlab Feb 1, 2016 at 19:35
  • @steeldriver, more the reason to believe, user has some way of running an executable from matlab related directories. User needs to find where the binaries are located and adjust the PATH variable accordingly.
    – MelBurslan
    Feb 1, 2016 at 21:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .