how to convert integer array to one value??
Afficher commentaires plus anciens
hi , i want to convert array such as x=[1;2;3;4;5] to one value as y=12345
Réponse acceptée
Plus de réponses (1)
Hey,
You can also use another (more mathematical) approach:
x = [1;2;3;4;5];
y = 0;
for i = 1:length(x)
y = y + (10^(i-1))*x(length(x)+1-i);
end
Greets
Catégories
En savoir plus sur Data Type Conversion dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!