PLOT problem

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)

Respuestas (3)

Andrew Newell
Andrew Newell el 27 de En. de 2012

0 votos

I think you are trying to do something like this:
x = 1:100;
c = cos(x);
plot (x,c)
Walter Roberson
Walter Roberson el 27 de En. de 2012

0 votos

xlim auto
ylim auto
Miguel
Miguel el 27 de En. de 2012

0 votos

Thanks, I found my error.

La pregunta está cerrada.

Etiquetas

Preguntada:

el 27 de En. de 2012

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by