how to convert integer array to one value??
Mostrar comentarios más antiguos
hi , i want to convert array such as x=[1;2;3;4;5] to one value as y=12345
Respuesta aceptada
Más respuestas (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
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!