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.
1 次查看(过去 30 天)
显示 更早的评论
S=0;
k=1;
while S>10000
S=(factorial(k-1))/2^(3*k+5);
k=k+1;
end
k
0 个评论
回答(2 个)
Steven Lord
2019-1-10
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!