MATLAB start up option -batch no recognized
조회 수: 4 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!