MATLAB start up option -batch no recognized

8 visualizaciones (últimos 30 días)
Ivan Aguilar
Ivan Aguilar el 13 de Mayo de 2019
Comentada: Ivan Aguilar el 13 de Mayo de 2019
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.

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 13 de Mayo de 2019
Editada: Sean de Wolski el 13 de Mayo de 2019
The -batch option was added in R2019a.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by