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)

 Réponse acceptée

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

3 commentaires

princess
princess le 28 Nov 2017
it works but what if I want my x to be what I mentioned above.
KSSV
KSSV le 28 Nov 2017
You will get distorted Sine wave. As the values are less..
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()

Connectez-vous pour commenter.

Plus de réponses (1)

princess
princess le 28 Nov 2017

0 votes

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

1 commentaire

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

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by