how can I plot this function?
1 次查看(过去 30 天)
显示 更早的评论
My problem is how to plot this function
回答(1 个)
David Hill
2022-10-27
t = linspace(-5,5,1000);
N = 1000;n=1:N;
an = (100*n*pi.*(-1).^(n+1).*(1000-121*n.^2*pi^2))/(((1000-121*n.^2*pi^2).^2 + (1320*n*pi).^2).*(50*n*pi));
bn = (100*n*pi.*(-1).^(n+1).*(1320*n*pi))./(((1000-121*n.^2*pi^2).^2 + (1320*n*pi).^2).*(50*n*pi));
f = @(t)sum(an.*cos(100*n*pi*t) + bn.*sin(100*n*pi*t));
for k=1:length(t)
F(k)=f(t(k));
end
plot(t,F)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!