gap in the plot

조회 수: 5 (최근 30일)
Valeria Pinus
Valeria Pinus 2019년 10월 31일
댓글: Walter Roberson 2019년 10월 31일
Снимок.PNG
How can I make the red plot start in the same place (from 1)?

답변 (1개)

Walter Roberson
Walter Roberson 2019년 10월 31일
red_x = red_x - min(red_x) + 1;
plot(blue_x, blue_y, 'b', red_x, red_y, 'r')
  댓글 수: 6
Valeria Pinus
Valeria Pinus 2019년 10월 31일
that way it says
Unable to perform assignment because the left and right sides have a different number of elements.
Error in lesson5_1 (line 24)
zi(i)=form2(X,Y,S,xi_new(i));
Walter Roberson
Walter Roberson 2019년 10월 31일
I see.
Your processing requires a gap. In form2 you have
i=max(find(X<z));
which would be empty if z is exatly equal to the first X because you are attempting to process right to the left margin.
You can reduce the width of the gap by reducing dx, but you cannot eliminate the gap.

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

카테고리

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

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by