Matlab not running from shell script (Ubuntu 18.04LTS)

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

I know that some aliasses are user-based. Are you perhaps running the script as yourself or with sudo?
@Rik Running the script as myself and not with sudo
@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?
@Jan Just running 'matlab' runs matlab without any trouble.
The folder containing Matlab's binary is included in the path

Sign in to comment.

Answers (1)

Jan
Jan on 5 May 2022
Edited: Jan on 5 May 2022
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

Products

Release

R2021a

Asked:

on 4 May 2022

Edited:

Jan
on 5 May 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!