how to convert integer array to one value??
Ältere Kommentare anzeigen
hi , i want to convert array such as x=[1;2;3;4;5] to one value as y=12345
Akzeptierte Antwort
Weitere Antworten (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
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!