Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 21 Déc 2016
Modifié(e) : Andrei Bobrov le 21 Déc 2016
b = str2double(sprintf('%d',a))
other way
b = 10.^(numel(a)-1:-1:0)*a

1 commentaire

may be a slight correction in your second way:
b = sum(10.^(numel(a)-1:-1:0).*a)

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by