在MATLAB中绘制循环 [英] Plot inside a loop in MATLAB
本文介绍了在MATLAB中绘制循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在做这样的事情:
a = [1:100];
for i=1:100,
plot([1:i], a(1:i));
end
我的问题是,直到循环结束才显示该图. 如何在每次迭代中显示/更新图?
My issue is that the plot is not shown until the loop is finished. How can I show/update the plot in every iteration?
推荐答案
使用或者,您可能希望查看文件中的 ANYMATE 交换.
Alternatively, you may want to have a look at ANYMATE from the file exchange.
这篇关于在MATLAB中绘制循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文