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 ?
mergemerge array
>>x=1:5;do some operation on x and get the result like>>y=12345
x=1:5;y=0;for i=1:length(x)y=y*10+x(i);end
Best Answer