plot a fourier series representation of function
1 view (last 30 days)
Show older comments
2 Comments
Ameer Hamza
on 30 Sep 2020
Since this is a homework question, what have you tried already? Also: https://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
Accepted Answer
Ameer Hamza
on 30 Sep 2020
Edited: Ameer Hamza
on 30 Sep 2020
Check this code
t = linspace( -pi , pi );
y1 = zeros(size(t));
for i = 1:2:5
y1 = y1 + (4/pi)*(sin(i*t)/i);
end
y2 = zeros(size(t));
for j= 1:2:39
y2 = y2 + (4/pi)*(sin(j*t)/j);
end
subplot(2,1,1)
plot(t, y1)
subplot(2,1,2)
plot(t, y2)
0 Comments
More Answers (0)
See Also
Categories
Find more on Get Started with MATLAB 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!