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
Andreas Goser 2012년 2월 2일

0 개 추천

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
Walter Roberson 2012년 2월 2일
Be safe, plot defensively!
http://www.mathworks.com/matlabcentral/answers/22208-show-figure

댓글을 달려면 로그인하십시오.

카테고리

태그

질문:

2012년 2월 2일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by