MATLAB: How to merge two matrices

concatenaionMATLABmatrix

I have two matrices with a= 20×6 and b=20×3 how can I merge them as 20×9.
thanks.

Best Answer

Horizontal concatenation
c=[a b]
example
for horizontal concatenation
a=rand(20,6);
b=rand(20,3);
c=[a b]
for vertical concatenation
a=rand(6,20)
b=rand(3,20)
c=[a;b]