photo

Ans sadiq


Last seen: oltre 2 anni fa Attivo dal 2021

Followers: 0   Following: 0

Statistica

MATLAB Answers

0 Domande
2 Risposte

RANK
23.429
of 300.331

REPUTAZIONE
2

CONTRIBUTI
0 Domande
2 Risposte

ACCETTAZIONE DELLE RISPOSTE
0.00%

VOTI RICEVUTI
1

RANK
 of 20.920

REPUTAZIONE
N/A

VALUTAZIONE MEDIA
0.00

CONTRIBUTI
0 File

DOWNLOAD
0

ALL TIME DOWNLOAD
0

RANK

of 168.124

CONTRIBUTI
0 Problemi
0 Soluzioni

PUNTEGGIO
0

NUMERO DI BADGE
0

CONTRIBUTI
0 Post

CONTRIBUTI
0 Pubblico Canali

VALUTAZIONE MEDIA

CONTRIBUTI
0 Punti principali

NUMERO MEDIO DI LIKE

  • First Answer

Visualizza badge

Feeds

Visto da

Risposto
I want to write a recursive Function that can calculate the sum of all the digit. If the input is 12345 then the answer will be 1+2+3+4+5 , without using string2num and loop.
function out=digit_sum(in) q=in; a=q/10; b=floor(a); c=q-b*10; w=c; if q>0 w=w+digit_sum(b); end out=w; end ...

circa 4 anni fa | 0

Risposto
Sum the digits of a number?
function out=digit_sum(in) q=in; a=q/10; b=floor(a); c=q-b*10; w=c; if q>0 w=w+digit_sum(b); end out=w; end ...

circa 4 anni fa | 1