Two Figures with multiples in one loop
显示 更早的评论
How can i have two separate figures each with multiple lines in the same For loop? I don't want to use subplot.
回答(1 个)
Andreas Goser
2012-2-2
Just make sure you use the figure handles before plotting into the one or the other figure. Example code
h1=figure;
h2=figure;
for k=1:10
r=rand(1,100)+k;
figure(h1)
hold on
plot(r)
pause(0.5)
r=rand(1,100)+k;
figure(h2)
hold on
plot(r)
pause(0.5)
end
1 个评论
Walter Roberson
2012-2-2
Be safe, plot defensively!
http://www.mathworks.com/matlabcentral/answers/22208-show-figure
类别
在 帮助中心 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!