MATLAB script run through terminal
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuestas (1)
Walter Roberson
el 18 de Jun. de 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.
0 comentarios
Ver también
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!