Matlab not running from shell script (Ubuntu 18.04LTS)
Show older comments
Matlab 2021a is not running when initiated from a shell script. The codes attempted are:
matlab -nodisplay -nosplash -nodesktop -r "run('/full_path/matlab_file.m');"
matlab -nodisplay -nosplash -nodesktop -batch "run('/full_path/matlab_file.m');"
The error shown is: "matlab: not found".
PS: Matlab runs and the code runs perfectly when launched directly from command line (by entering 'matlab' from command line.)
4 Comments
Rik
on 4 May 2022
I know that some aliasses are user-based. Are you perhaps running the script as yourself or with sudo?
Digantara SSC
on 4 May 2022
Jan
on 4 May 2022
@Digantara SSC: What happens, if you just run "matlab"? If this does not start also, is the folder containing Matlab's binary included in the path?
Digantara SSC
on 5 May 2022
Edited: Digantara SSC
on 5 May 2022
Answers (1)
Try this from the shell of the operating system:
matlab
matlab -nodisplay -nosplash -nodesktop
matlab -nosplash -r "isfile('/full_path/matlab_file.m')"
I assume a typo in "/full_path/matlab_file.m".
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!