MATLAB: Merge values of a vector

scalarvector

Hey matlab community,
I want to merge the values of a vector to a single scalar. So for example i have the vector z = (1,2,3,4). The final value should be 1234.
Thanks in advance

Best Answer

Like this?
x = 1:4; % sample input array
s = num2str(x,'%d');
y = str2double(s);
>> y
y =
1234
Related Question