Info

This question is closed. Reopen it to edit or answer.

PLOT problem

1 view (last 30 days)
Miguel
Miguel on 27 Jan 2012
Closed: MATLAB Answer Bot on 20 Aug 2021
I somehow change the default values for the axis and now is showing x from -1 to 1 and y from 0 to 2.
This is all the code I have.
x = zeros (100,1);
for i = 1:1:100;
c = cos(x);
s = sin(x);
t = tan(x);
sqr = sqrt(x);
expon = x.^2;
inverse = 1./x.^2;
end
plot (x,c)

Answers (3)

Andrew Newell
Andrew Newell on 27 Jan 2012
I think you are trying to do something like this:
x = 1:100;
c = cos(x);
plot (x,c)

Walter Roberson
Walter Roberson on 27 Jan 2012
xlim auto
ylim auto

Miguel
Miguel on 27 Jan 2012
Thanks, I found my error.
  1 Comment
Andrew Newell
Andrew Newell on 27 Jan 2012
Just one?

This question is closed.

Community Treasure Hunt

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

Start Hunting!