I want to get minimum number of k for the sum of series to be greater than 10000. But I am getting S=0 and k=1 only.
2 views (last 30 days)
Show older comments
S=0;
k=1;
while S>10000
S=(factorial(k-1))/2^(3*k+5);
k=k+1;
end
k
0 Comments
Answers (2)
Steven Lord
on 10 Jan 2019
Is 0 greater than 10000? If not, MATLAB will never enter the body of your while loop. Your condition is incorrect.
BTW, your title references "sum of series" but there's no summation (other than k = k + 1) in your code. You're probably missing a bit in the first statement in the body of your while loop.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!