MATLAB: Convert two column matrices into one column matrix

convert two column matrices into one column matrix

Hello I want to combine two column vector matrices into one column vector matrix like the example A=[1;4;6;7;8] B=[10;21;11;9] C must be like: C=[1;4;6;7;8;10;21;11;9]
I need a general answer because I have many and large columns. Thank you

Best Answer

C = [A(:);B(:)]
This is a pretty basic question. I recommend you read the "Getting started" part of the documentation.