How can I plot with a different axe

조회 수: 2 (최근 30일)
Ach
Ach 2018년 6월 14일
댓글: Walter Roberson 2018년 6월 14일
Hi ,
I have the following code and I am trying to plot A . I get a plot with an x-axe from 1 to 40 .
s = linspace (-1,1,40);
A : 40x20x20 double %A matrix
plot(A(:,15,10))
How can I modify my code to get a plot with an x-achse from -1 to 1 ?

채택된 답변

Walter Roberson
Walter Roberson 2018년 6월 14일
plot(s, A(:,15,10))

추가 답변 (1개)

Jeffrey Eymer
Jeffrey Eymer 2018년 6월 14일
You should be able to accomplish this using the xlim function.
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 6월 14일
Not in this case. The user was not passing in an x variable, so plot assumes 1 : size(A,1) should be used.

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

카테고리

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