How can I plot with a different axe

2 次查看(过去 30 天)
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 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by