MATLAB: How to combine two matrices in the form of ordered pairs

combine matricesmatrix

I have two matrices A and B which are for example
A=[1 2 3;2 3 1; 3 1 2] and B=[1 2 3;3 1 2;1 3 2]
And I would like to combine these matrices so that every other column is from A and every other is from B. So the answer should be matrix such that each entry is in the form of ordered pair or there is no space between them i.e.,
[ (1,1) (2,2) (3,3);(2,3) (3,1) (1,2);(3,1) (1,3) (2,2)]

Best Answer

It would seem that your ordered pairs are actually two digits integers formed by putting the first element as decades, and the second as units. If that is the case, this is trivially achieved by:
A = [1 2 3; 2 3 1; 3 1 2]
B = [1 2 3; 3 1 2; 1 3 2]
C = 10*A + B