Could someone explain what the code means?
3 views (last 30 days)
Show older comments
Rui Luo
on 29 Nov 2020
Answered: Walter Roberson
on 29 Nov 2020
s = 0;
t = Inf;
n = 0;
while s ~= t
n = n+1;
t = s;
s = s + 1/n^4;
end
s
0 Comments
Accepted Answer
Walter Roberson
on 29 Nov 2020
1/1^4 + 1/2^4 + 1/3^4 + 1/4^4 + 1/5^4 + 1/6^4 and keep going adding values until the number stops changing (which will happen because the values start getting too small to individually make a difference)
0 Comments
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements 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!