-
2 Comments
晧瑜戴on 30 Apr 2020
function b = sumDigits(n)
pow=2^n;
b = 0;
while pow~=0
b=b+mod(pow,10);
pow=floor(pow/10);
end
end
Syed Shahedon 2 May 2020
The code is wrong. Cause the while doest have a stopping condition.
Suggested Problems
Remove the small words from a list of words.
987 Solvers
Basics: 'Find the eigenvalues of given matrix
358 Solvers
356 Solvers
解决328
460 Solvers
More from this Author95
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!