Question about single digits.

Hi everyone. Is there any function that converts "complex" number for example [123] to constituent elements [1 2 3] ?

 Risposta accettata

Its not the most elegant, but this works:
A = str2num(num2str(123)')'

Più risposte (1)

Artyom
Artyom il 13 Lug 2012

0 voti

Thanks. Maybe you know how to do the reverse process - from [5] [5] to [55]?

2 Commenti

A = [ 1 2 3 ];
S = sum( A .* ( 10 ^ (numel(A)-1:-1:0 ) ) )
F.
F. il 13 Lug 2012
;-)

Accedi per commentare.

Categorie

Scopri di più su Programming 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!

Translated by