MATLAB: How to concatenate two or more arrays without using num2str

concatenate arrays

For example if I have two vertical arrays:
A = [1;2] B = [3;4]
I need this output:
C = [13; 24]
The problem is that my arrays have many rows, thus num2str is too slow. What can I do? Thanks!!!

Best Answer

The most obvious solution is to appreciate how a number is constructed in decimal form. So, rather than convert to characters, then concatenate, and then go back in to numeric form, simply use base 10.
C = 10*A + B;