Update workspace variables in a loop

조회 수: 11 (최근 30일)
Tejas
Tejas 2020년 5월 14일
댓글: Tejas 2020년 5월 14일
I'm running a for loop in which, at the end of every iteration, a graph is plotted. I need to see the changes happening over the loop, hence I'm using the drawnow feature. This allows me to view the changes happening in the graph at every step. I'd also like to do something like this in the workspace. Say for a simple loop like
for i = 1:10
a = i;
end
I want to view the value of 'a' changing in the workspace. I tried using pause, but it does not update the workspace. Is there any way I can do this? Thank you.
  댓글 수: 2
Tommy
Tommy 2020년 5월 14일
I would take a look at this:
Would it work for you to either print values to the command window or display them in a figure?
Tejas
Tejas 2020년 5월 14일
Thank you. I'll take a look at the Live Editor. Yeah I think printing them in the command window might be another alternative.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by