Using loop to solve a summation

Answers (2)

No, because you need to subscript ‘m’ and sum ‘x’ in each iteration.
However you do not need the loop:
m=0:1200;
x=sum(1./factorial(m))
Kevin Phung
Kevin Phung on 7 Feb 2019
Edited: Kevin Phung on 7 Feb 2019
No, you need to increment m with each step and add each partial sum.
This is what you need:
x= 0
for m = 0:1200
x = x + 1/factorial(m(i))
end

2 Comments

why x if there is no x in the equation
x is just the variable that will store that whole summation

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Asked:

on 7 Feb 2019

Commented:

on 23 Apr 2021

Community Treasure Hunt

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

Start Hunting!