MATLAB script run through terminal

2 vues (au cours des 30 derniers jours)
Rupamathi Jaddivada
Rupamathi Jaddivada le 17 Juin 2017
Hi, I used the command 'matlab -r 'try filename(args); catch;end;quit' in order to run a simulation remotely. However, I don't know how to check the status of completion. I don't even know how to stop the simulation. Please let me know if there is anyway I can resolve these issues.
Thanks, Rupa

Réponses (1)

Walter Roberson
Walter Roberson le 18 Juin 2017
The completion of the MATLAB command itself can be checked in most shells by looking at the $? variable; http://www.linuxnix.com/find-exit-status-script-command-linux/
If you are talking about the status of individual commands within the function, you can look at the standard output. If you want to write stdout to a file while still looking at it interactive, use the shell tee command. The question of when exactly MATLAB flushes its output buffer can be important in some cases.
You could also consider using the MATLAB diary command.
"I don't even know how to stop the simulation"
If you are running interactively in a shell, then unless you have altered your termios settings (by using the stty command, probably), you can control-c to interrupt the execution, or you can (probably) control-Z to pause the execution. Sometimes execution gets stuck beyond the ability of control-C to fix it, or if you are not running interactively, you may need to kill the process.

Catégories

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by