필터 지우기
필터 지우기

Line each iteration when plotting in a for loop

조회 수: 1 (최근 30일)
Auryn_
Auryn_ 2015년 11월 6일
댓글: Auryn_ 2015년 11월 6일
Hello,
I am trying to plot several loops for different values of a variable. When using "hold on" there is a line appearing in each iteration. I would like to have a plot without all those lines. This is the code:
Fmat(t_index,:)=[t_index F];
plot (Fmat (:,1), Fmat (:,2));
drawnow
hold on
Thanks a lot in advance for your reply!

답변 (1개)

Thorsten
Thorsten 2015년 11월 6일
Why not get rid of "hold on"?
  댓글 수: 3
Thorsten
Thorsten 2015년 11월 6일
Ok, so what exactly do you want to plot, and what is plotted instead? What is the "line" that appears in each iteration? Without some more code this is hard to answer.
Auryn_
Auryn_ 2015년 11월 6일
Ok, yes I understand it is difficult.
There is a "for loop" for some values N=2,3,4... for each N there is another "for loop" for the variable t_index. At the end I should have a plot (call it a line) for each value of N where in my x axis the values are those t_index of the second loop.
Actually I just solved it. I had to plot it after I ended the second for loop.
Thanks anyway!

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

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by