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
Mostra commenti meno recenti
function r = length_of(n)
end
it seems to be easy but right now i'm stuck with it
Risposta accettata
Più risposte (1)
Wayne King
il 30 Mar 2013
Why recursive?
A = 12;
B = 1000;
length(num2str(A))
length(num2str(B))
1 Commento
Categorie
Scopri di più su Whos in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!