MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   在MATLAB中绘制循环 (https://www.labfans.com/bbs/showthread.php?t=23402)

poster 2019-12-10 20:41

在MATLAB中绘制循环
 
我正在做这样的事情:

a = [1:100]; for i=1:100, plot([1:i], a(1:i)); end 我的问题是直到循环结束才显示该图。如何在每次迭代中显示/更新图?



[B]回答:[/B]

使用[URL="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/drawnow.html"]DRAWNOW[/URL]

a = [1:100]; for i=1:100, plot([1:i], a(1:i)); drawnow end 另外,您可能希望从文件交换中查看[URL="http://www.mathworks.com/matlabcentral/fileexchange/18210-anymate"]ANYMATE[/URL] 。



[url=https://stackoverflow.com/questions/2800066]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 01:05

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.