Graphing partial sums of harmonic fourier series

14 visualizaciones (últimos 30 días)
lala land
lala land el 1 de Oct. de 2022
Respondida: Torsten el 1 de Oct. de 2022
Hi,everyone. So I have calculated by hand the sine and cousine fourier series in summation form. I was asked to plot the partial sum up to the fifth harmonic of the fourier cosine representation for x=-2 to 4 but I am ensure of how to do it. The cut off line of code is just the equation inside the summation

Respuestas (2)

Walter Roberson
Walter Roberson el 1 de Oct. de 2022
Use
x = linspace(-2, 4, 200);
Currently you are using x = [-2, -1, 0, 1, 2, 3, 4] which is not enough to get a decent graph.

Torsten
Torsten el 1 de Oct. de 2022
x = (linspace(-2,4,200)).';
n = 1:5;
f = 1 - exp(-1) + 2*sum((1-(-1).^n*exp(-1))./(1+n.^2*pi^2).*cos(n.*pi.*x),2);
plot(x,f)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by