MATLAB start up option -batch no recognized

조회 수: 4 (최근 30일)
Ivan Aguilar
Ivan Aguilar 2019년 5월 13일
댓글: Ivan Aguilar 2019년 5월 13일
I have the following code using MATLAB 2016B on Linux:
/usr/local/MATLAB/R2016b/bin/matlab -nodisplay -nosplash -batch "run myFunc(1)"
The same code (except the directory of the MATLAB executable and version number which is 2018b on my Macbook) works on my Macbook, but not on my Linux machine for some reason. It seems it's the -batch command that isn't being supported, but I've followed the documentation listed here: https://www.mathworks.com/help/matlab/ref/matlablinux.html
Specifically, I get the errors:
/usr/local/MATLAB/R2016b/bin/matlab: 1: eval: Syntax error: "(" unexpected
Unrecognized MATLAB option "batch".
This works on my Macbook but I'd like to have this running on my Linux Desktop. I have the command in a .sh file which I'm calling through C++ using the system(...) command in order to run simulations overnight. MATLAB does a specific function that I do not have access to in C++, which is why I'm doing this.
It works in Linux if I do: /usr/local/MATLAB/R2016b/bin/matlab -nodisplay -nosplash -r "run myFunc(1); exit"
While I do have a solution, I'd like to understand why the original statement doesn't work in Linux.

채택된 답변

Sean de Wolski
Sean de Wolski 2019년 5월 13일
편집: Sean de Wolski 2019년 5월 13일
The -batch option was added in R2019a.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by