MATLAB: Move matrix rows and columns

move matrix rows and columnsreshape

I have a n*n matrix. I want to convert it to n^2*1 matrix. for example: A=[a b;c d] result B=[a;b;c;d]

Best Answer

B=reshape(A.',[],1);