Can I see values of variables while a code is running.
37 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jeon
el 12 de Ag. de 2013
Comentada: Jim Riggs
el 3 de Ag. de 2018
MATLAB on my PC is running a code that takes a very long time with a huge iteration.
I haven't put any disp, fprintf, etc in the code. Thus, I can't see how many iterations are done.
In this situation, can I access to the variables without halting the code ?
0 comentarios
Respuesta aceptada
Walter Roberson
el 12 de Ag. de 2013
If you have code that is already running, and it is not already displaying the values, then there is no way to turn on displaying the values -- not without interrupting the run.
2 comentarios
Más respuestas (3)
Azzi Abdelmalek
el 12 de Ag. de 2013
You can use display function
a=10
display(a)
But this will make your code slower
0 comentarios
Peter Marko
el 2 de Ag. de 2018
Editada: Peter Marko
el 2 de Ag. de 2018
See https://www.mathworks.com/matlabcentral/answers/228916-tracking-the-value-of-a-variable-in-debug-mode#answer_185281 (use variable name on a separate line)
0 comentarios
Steven Lord
el 2 de Ag. de 2018
As of release R2016a the Editor has a Pause button that will pause execution at the next executable line.
0 comentarios
Ver también
Categorías
Más información sobre Environment and Settings 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!