Info
この質問は閉じられています。 編集または回答するには再度開いてください。
how to put out figure one by one when many figures should be put out?
1 回表示 (過去 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!