how can i find the exact sin graph in matlab

I used the following program to plot sin function but I found a different graph and I don't get it.
x=[0:10];
y=sin(x);
plot(y)

 Respuesta aceptada

KSSV
KSSV el 28 de Nov. de 2017
x=0:0.01:10;
y=sin(x);
plot(y)
Increase the number of points in x.

3 comentarios

princess
princess el 28 de Nov. de 2017
it works but what if I want my x to be what I mentioned above.
KSSV
KSSV el 28 de Nov. de 2017
You will get distorted Sine wave. As the values are less..
Walter Roberson
Walter Roberson el 28 de Nov. de 2017
If you want your x to be what you mentioned above, then you get the graph that you do.
I wonder by the way whether you are thinking degrees or radians? If you are thinking 0 to 10 degrees then you should use sind() not sin()

Iniciar sesión para comentar.

Más respuestas (1)

princess
princess el 28 de Nov. de 2017

0 votos

what is the difference between "cloop" and "feedback" codes in matlab

1 comentario

Walter Roberson
Walter Roberson el 28 de Nov. de 2017
cloop is a variable name that is used in some of the examples.
feedback() is a function from the Control System Toolbox; https://www.mathworks.com/help/control/ref/feedback.html

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 28 de Nov. de 2017

Comentada:

el 28 de Nov. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by