Info

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

How to use matlab to calculate this sum?

1 次查看(过去 30 天)

回答(1 个)

KSSV
KSSV 2020-8-10
编辑:KSSV 2020-8-10
With loop
N = 1000 ;
thesum = 0 ;
for i = 1:N
thesum = thesum +(1/i+1/((i+2)*(i+3))) ;
end
Without loop
N = 1000 ;
i = 1:N ;
s = 1./i+1./((i+2).*(i+3)) ;
thesum = sum(s) ;
  3 个评论
KSSV
KSSV 2020-8-10
What have you tried? That code will not show any error....it will run.
VBBV
VBBV 2020-8-10
编辑:VBBV 2020-8-10
Yeah. The summation of the series is thesum = 7.8178
Code has no error

Community Treasure Hunt

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

Start Hunting!

Translated by