Fourier series with MATLAB

1 vue (au cours des 30 derniers jours)
Luis Miguel López Santamaría
Commenté : Akira Agata le 25 Mai 2017
Hello everybody,
I have a little trouble here, I'm working with Fourier series, I already calcule Ao, An and Bn these is the following code:
Ao = 0;
for i=1:length(f)
Ao = Ao +int(f(i),'t', inter(i), inter(i+1));
end
Ao = simplify(Ao/T);
An = 0;
wo = 2*pi/T;
for i=1:length(f)
An = An +int(f(i)*cos(n*wo*t), inter(i), inter(i+1));
end
An = simplify(2*An/T);
Bn = 0;
for i=1:length(f)
Bn = Bn +int(f(i)*sin(n*wo*t), inter(i), inter(i+1));
end
Bn = simplify(2*Bn/T);
But now I want to express like this form:
This is the following formula:
Thank you for your help
  1 commentaire
Akira Agata
Akira Agata le 25 Mai 2017
I'm not sure what you want to do, but I guess you are trying to do the following. The following code calculates the first equation of your post up to Nterm th terms.
t = linspace(0, 4*pi, 1000);
Nterm = 5;
ft = zeros(size(t));
for kk = 1:Nterm
ft = ft + sin((2*kk-1)*t)/(2*kk-1);
end
ft = ft*(4/pi);
figure
plot(t,ft);

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by