Drawing figure in a for loop
2 次查看(过去 30 天)
显示 更早的评论
Hello all,
I have a for loop and I want to see the progress of the figure as the loop goes. Basically the code is like this:
SNRdB=0:20;
nErr=zeros(length(SNRdB),1);
for ii=1:length(SNRdB)
...
nErr(ii)=...
figure(1)
semilogy(SNRdB,nErr)
end
However, when I write it this way the figure is halted during the next loop and I cannot see it. How can I see the figure freely while the loop is running?
Thanks
7 个评论
Geoff Hayes
2014-6-21
Right - and S. is minimizing it because he has other stuff to do and doesn't want to see that figure or have it occupy area on his screen. Only at some point later does S. want to review the figure to check the progress by "retrieving the figure frame from the task bar".
回答(2 个)
Star Strider
2014-6-21
2 个评论
Star Strider
2014-6-21
编辑:Star Strider
2014-6-21
Nothing in the UI functions offers a solution, unfortunately.
My only suggestion is to not minimise it to the taskbar but position the figure off to the side, and then click on it when you want to see it. This is my usual strategy, but then I don’t know what’s on your desktop or how it’s organised.
You can also bring it to the foreground by clicking on it on the toolbar even when it’s not minimised. If you don’t minimise it, you may avoid the problem entirely.
Image Analyst
2014-6-21
Why are you calling figure(1) at all? Just get rid of it. You can use maxfig (in MATLAB Central) to get the window state and if it's not minimized, call drawnow after you call plot.
6 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!