Plotting a Fourier Sine Series

18 views (last 30 days)
Will Jeter
Will Jeter on 4 Mar 2021
Answered: Monisha Nalluru on 8 Mar 2021
Need help plotting the following fourier sine series
f(z) = sum((-12/4n+2)(n*pi*z/L))
i think L can be assumed as 1

Answers (1)

Monisha Nalluru
Monisha Nalluru on 8 Mar 2021
Here is an example plot
z = 1:0.1:10;
n = 10;
ysin = fsin(z,n);
plot(z,ysin),grid
xlabel('x'),ylabel('sin function')
% Define functions
function f = fsin(z,n)
f = 0;
for i = 1:n
f = f + (-12/(4*i +2))*(i*pi*z/1);
end
end
Customize the values of z,x according
Refer to following documentation links:
https://www.mathworks.com/help/symbolic/fourier.html

Categories

Find more on 2-D and 3-D Plots 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!