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
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
function r = length_of(n)
end
it seems to be easy but right now i'm stuck with it
0 Kommentare
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
Siehe auch
Kategorien
Mehr zu Inputs finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!