MATLAB: Multiple columns to one column

<<
<<
>>Hi I am kinds of practicing the matlab code to edit some data
I am trying to edit the multiple columns of data to one columns like the pictures above.
Anyone help me with this problem??
>>

Best Answer

A=[1 2 3;4 5 6;7 8 9];
B=A(:)
% Or Use reshape function
B=reshape(A,[],1)