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!