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
Ältere Kommentare anzeigen
function r = length_of(n)
end
it seems to be easy but right now i'm stuck with it
Akzeptierte Antwort
Weitere Antworten (1)
Wayne King
am 30 Mär. 2013
Why recursive?
A = 12;
B = 1000;
length(num2str(A))
length(num2str(B))
1 Kommentar
Kategorien
Mehr zu Whos finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!