Info
此问题已关闭。 请重新打开它进行编辑或回答。
how to put out figure one by one when many figures should be put out?
2 次查看(过去 30 天)
显示 更早的评论
I have saved about 1,000 txt files on my PC somewhere; Now I want to scan the data of all these files, and select some ones to make figures according to the files' data (one selected file, one figure); so my logic code is as below:
for i=1:1000
if .....%(if selected)
figure;
end
end
Then I run the code and I find 45 figures were created, but the figures were created all at the end when 1,000 txt files were checked rather than one by one(check one file, if selected, figure). why?
in addition, the same code run well on matlab2012b(one by one), but not well on matlab2014b(all together at the end). or matlab2014b making all figures at the end is better? I find at the end, when all the figures were created together, my PC is very busy and hot, which I don't want to .
0 个评论
回答(2 个)
Walter Roberson
2015-11-12
After you finish plotting any one figure, use drawnow() . This should not normally be necessary as MATLAB should update graphics each time you figure() a new figure into existence, but I have seen reference to an R2014b / R2015a case in which drawnow needed to be used due to a graphics bug.
0 个评论
vx2008
2015-11-13
1 个评论
Walter Roberson
2015-11-13
If you do not need multiple figures displayed at the same time then it would generally be better not to have them displayed at the same time. Every figure that is simultaneously displayed requires graphics memory and requires data structures about how it should be interacted with, so you can reduce the workload on the system by getting rid of figures that you are finished with.
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!