MATLAB Answers

Ach
0

How can I plot with a different axe

Asked by Ach
on 14 Jun 2018
Latest activity Commented on by Walter Roberson
on 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 ?

  0 Comments

Sign in to comment.

Tags

2 Answers

Answer by Walter Roberson
on 14 Jun 2018
 Accepted Answer

plot(s, A(:,15,10))

  0 Comments

Sign in to comment.


Answer by Jeffrey Eymer on 14 Jun 2018

You should be able to accomplish this using the xlim function.

  1 Comment

Not in this case. The user was not passing in an x variable, so plot assumes 1 : size(A,1) should be used.

Sign in to comment.