how to convert integer array to one value??
Show older comments
hi , i want to convert array such as x=[1;2;3;4;5] to one value as y=12345
Accepted Answer
More Answers (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
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!