Update workspace variables in a loop
19 次查看(过去 30 天)
显示 更早的评论
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
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?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!