Info

This question is closed. Reopen it to edit or answer.

How to use matlab to calculate this sum?

1 view (last 30 days)
Chairil Ooi Chi Zen
Chairil Ooi Chi Zen on 10 Aug 2020
Closed: MATLAB Answer Bot on 20 Aug 2021

Answers (1)

KSSV
KSSV on 10 Aug 2020
Edited: KSSV on 10 Aug 2020
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 Comments
KSSV
KSSV on 10 Aug 2020
What have you tried? That code will not show any error....it will run.
VBBV
VBBV on 10 Aug 2020
Edited: VBBV on 10 Aug 2020
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!