-
1 Comment
kifah alzoubi
on 29 Dec 2016
function b = sumDigits(n)
%SUMDIGITS Given n, find the sum of the digits that make up 2^n
in=num2str(2^n);
b=sum(str2num(in(:)));
end
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!