Can I see values of variables while a code is running.
Show older comments
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 ?
Accepted Answer
More Answers (3)
Azzi Abdelmalek
on 12 Aug 2013
You can use display function
a=10
display(a)
But this will make your code slower
Peter Marko
on 2 Aug 2018
Edited: Peter Marko
on 2 Aug 2018
0 votes
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)
Steven Lord
on 2 Aug 2018
0 votes
As of release R2016a the Editor has a Pause button that will pause execution at the next executable line.
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!