how do i create a recursive function that gives the number of digits in an integer? i.e. does the same that length function does in MATLAB
Show older comments
function r = length_of(n)
end
it seems to be easy but right now i'm stuck with it
Accepted Answer
More Answers (1)
Wayne King
on 30 Mar 2013
Why recursive?
A = 12;
B = 1000;
length(num2str(A))
length(num2str(B))
1 Comment
Categories
Find more on Logical 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!