MATLAB start up option -batch no recognized

8 vues (au cours des 30 derniers jours)
Ivan Aguilar
Ivan Aguilar le 13 Mai 2019
Commenté : Ivan Aguilar le 13 Mai 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.

Réponse acceptée

Sean de Wolski
Sean de Wolski le 13 Mai 2019
Modifié(e) : Sean de Wolski le 13 Mai 2019
The -batch option was added in R2019a.
  1 commentaire
Ivan Aguilar
Ivan Aguilar le 13 Mai 2019
Ah that explains it, thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by