Can I see values of variables while a code is running.
조회 수: 35 (최근 30일)
이전 댓글 표시
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
채택된 답변
Walter Roberson
2013년 8월 12일
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
추가 답변 (3개)
Azzi Abdelmalek
2013년 8월 12일
You can use display function
a=10
display(a)
But this will make your code slower
댓글 수: 0
Peter Marko
2018년 8월 2일
편집: Peter Marko
2018년 8월 2일
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
Steven Lord
2018년 8월 2일
As of release R2016a the Editor has a Pause button that will pause execution at the next executable line.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!