How can I plot with a different axe

2 Ansichten (letzte 30 Tage)
Ach
Ach am 14 Jun. 2018
Kommentiert: Walter Roberson am 14 Jun. 2018
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 ?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 14 Jun. 2018
plot(s, A(:,15,10))

Weitere Antworten (1)

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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by