Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Why are these plots different?

조회 수: 1 (최근 30일)
Zachary Duff
Zachary Duff 2018년 6월 1일
마감: MATLAB Answer Bot 2021년 8월 20일
I understand why the xlabel is different, but I don't understand why the image is different, while structurally appearing the same. I'm using a uniform time step for my algorithm (h = 0.01). t,z are both 22401x1 doubles. plot(z) leads to the first image, plot(t,z) leads to the second.

답변 (1개)

Jan
Jan 2018년 6월 1일
The diagrams are different, because the scaling differs. This is exactly what is expected, when you define the x component of the data or omit this information. Therefore it is not clear, what your question is. You draw two different things, then you can expected, that they look different. To get the same output, you can equalize the scaling and limits:
subplot(1,2,1);
plot(z)
axis tight
subplot(1,2,2);
plot(t,z)
axis tight
  댓글 수: 1
Zachary Duff
Zachary Duff 2018년 6월 7일
No, this wasn't the case, it happened because of a rounding error in my stepsize variable. The output data in the lower plot was misaligned with its input variable.

이 질문은 마감되었습니다.

태그

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by