Fourier series doesnt overlap function
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
b = zeros(1,7);
x = linspace(-2,2,200);
f = ((8+x.^3)).^(1/2);
b0 = trapz(x,f);
for n = 1:7
y = f.*sin(n*pi*x/2);
b(n) = trapz(x,y);
end
fh = zeros(1,200);
for n = 1:7
fh = fh + b(n)*sin(n*pi*x/2);
end
fh = b0/2 + fh;
plot(x,f,'r','LineWidth',3)
hold on
plot(x,fh,'b','LineWidth',1)
hold off
legend('f','fh','Location','best')
title('N/A')
Can anyone see why the fourier series of f doesnt line up with the function f?
0 件のコメント
回答 (0 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!