Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How to use matlab to calculate this sum?

1 vue (au cours des 30 derniers jours)
Chairil Ooi Chi Zen
Chairil Ooi Chi Zen le 10 Août 2020
Clôturé : MATLAB Answer Bot le 20 Août 2021

Réponses (1)

KSSV
KSSV le 10 Août 2020
Modifié(e) : KSSV le 10 Août 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 commentaires
KSSV
KSSV le 10 Août 2020
What have you tried? That code will not show any error....it will run.
VBBV
VBBV le 10 Août 2020
Modifié(e) : VBBV le 10 Août 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!

Translated by