Info

此问题已关闭。 请重新打开它进行编辑或回答。

please help me, how do I make the code for the equation in the following picture?

1 次查看(过去 30 天)
  3 个评论

回答(1 个)

Peter O
Peter O 2020-4-17
You can't code an infinite sum exactly, but fortunately, this one is bounded (x^2 on the denominator and the numerator is bounded between -1 and 1).
Pick a big n:
n_max=100;
ns = 1:n_max;
sum_n = cumsum( sin(2*ns)./ns.^2);
plot(ns, sum_n)
You will see it very quickly converges, after 20 terms or so.
  5 个评论

标签

尚未输入任何标签。

产品


版本

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by