Sum of a series?

1 次查看(过去 30 天)
John Mitchell
John Mitchell 2019-10-15
评论: Matt J 2019-10-15
I'm having some trouble even finding somewhere to start with these problems, where I have to find the sum of these without using for loops:
1) 1/(1*2) + 1/(2*3)+ 1/(3*4)+ 1/(4*5)+....1/(99*100)
2) e^1-e^2+e^3-e^4....+e^99-e^100
3) x+ x^2/2 + x^3/3 + x^4/4 +.... x^10/10 for x = 0.5

回答(1 个)

Matt J
Matt J 2019-10-15
Hint:
>> 1./(1:5)
ans =
1.0000 0.5000 0.3333 0.2500 0.2000
  4 个评论
John Mitchell
John Mitchell 2019-10-15
Thank you so much! I got the first one to work now, and I think I have a idea of how to do the third one, but I am still clueless on how to do the changing signs of the second one
Matt J
Matt J 2019-10-15
The second one is a geometric series with ratio r=-exp(1). It has a closed form formula.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by