MATLAB: Merge array to a number

mergemerge array

I want to merge an array to a number. i.e., if
>>x=1:5;
do some operation on x and get the result like
>>y=12345
for that I have written this code…
x=1:5;
y=0;
for i=1:length(x)
y=y*10+x(i);
end
Is there any short way to do this ?

Best Answer

str2double(sprintf('%d',x))
Related Question