How to plot a smooth graph?
Show older comments
clc,clear all
b0 = 0.015;
b1 = 0.015;
b2 = 0.035;
b3 = 0.050;
v = 40; %velocity
L = 2;
w = (2*pi*v)/L; %angular frequency
F = w*(1/(2*pi)); %in Hz
t = linspace(0,10,18);
b = b0 + b1*sin(w*t) + b2*sin(2*w*t)
+b3*sin(3*w*t);
plot(t,b)
Hi, I want to make this graph as being a smooth graph.
Thank you for your time.
1 Comment
Rik
on 2 Apr 2020
Although you could resample your function to draw a smooth curve through your data points, that would not accurately describe your function. You can greatly increase the number of points in your t vector to see that you have an enormous amount of aliasing going on here. See this Wikipedia page for more information.
Accepted Answer
More Answers (1)
Walter Roberson
on 2 Apr 2020
t = linspace(0,10,18);
Increase the 18 to something larger, such as 50.
1 Comment
donghun lee
on 2 Apr 2020
Categories
Find more on Spline Postprocessing 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!