how can i find the exact sin graph in matlab

1 view (last 30 days)
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)

Accepted Answer

KSSV
KSSV on 28 Nov 2017
x=0:0.01:10;
y=sin(x);
plot(y)
Increase the number of points in x.
  3 Comments
KSSV
KSSV on 28 Nov 2017
You will get distorted Sine wave. As the values are less..
Walter Roberson
Walter Roberson on 28 Nov 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()

Sign in to comment.

More Answers (1)

princess
princess on 28 Nov 2017
what is the difference between "cloop" and "feedback" codes in matlab
  1 Comment
Walter Roberson
Walter Roberson on 28 Nov 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

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!