MATLAB: Do the LS and ! (bang) commands not work in MATLAB 7.7 (R2008b) when the $MATLAB_SHELL environment variable is set

envhatlinuxMATLABredshellsuse

I have the environment variable $MATLAB_ROOT set to 'bash', and when I try to run the LS command in MATLAB I get the following error message.
??? Error using ==> ls at 38
Similarly, shelling out commands with the bang operator (!) do not work.

Best Answer

If you would like to set the $MATLAB_SHELL then it must be set with an absolute path. For instance if, outside of MATLAB, you get the following result:
> which bash
/bin/bash
Then $MATLAB_SHELL should be set to /bin/bash, not simply bash.