The code to run matlab in bash script:
matlab -nodesktop -nosplash -nodisplay -r "run ./myDir/myfile ; quit;"
I have Matlab installed on my computer, however when I run the bash script I get this error:
matlab:not found
I don't know if it is because of the Matlab's path (/home/myComputerName/Documents/MATLAB/bin/matlab) in my computer, which is located under /Documents/.
What causes this problem? If it is because of the path, is there a general solution, i.e. running matlab is independent where it is installed, for this?
which matlaborwhereis matlabto see if you havematlabin yourpathand installed in your machine. You can always add/Documentsto yourPATHif you havematlabthere and dnt want to type./Documents/matlabexport PATH=$PATH:/Documents/MATLAB/bin/matlaband then runmatlabfrom the cmd prompt. Let me know if this works./Documentsseems unlikely to exist on an Ubuntu install. Are you sure it isn't actually in$HOME/Documents? If so, that needs to go in the path line.export PATH=$PATH:/home/myComputerName/Documents/MATLAB/binthen