How do i script to calculate the Sum for the following expression

1 view (last 30 days)
I need help for this question. I'm a matlab beginner so i have no idea how to do this.

Answers (1)

KSSV
KSSV on 9 Dec 2020
You can also achieve the same without suing loop. This is called vectorization. You should read about element by element divison and element by element multiplication.
n = 100 ;
i = 1:n;
f = 1./i+1./((i+2).*(i+3)) ;
thesum = sum(f) ;

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!