Fourier series with MATLAB

1 回表示 (過去 30 日間)
Luis Miguel López Santamaría
Luis Miguel López Santamaría 2017 年 5 月 21 日
コメント済み: Akira Agata 2017 年 5 月 25 日
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 件のコメント
Akira Agata
Akira Agata 2017 年 5 月 25 日
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);

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by