MATLAB: Convert a matrix to column vector

matrix to a colume vector

I woule like to convert a matrix [31,6000] to a cloumn vector
31 rows and 6000 column
to one column vector
please advice

Best Answer

TheMatrix(:)
%or
reshape(TheMatrix,[],1)
The order would be all of column 1, followed by all of column 2, then all of column 3, and so on.
If you need it to be ordered all of row 1 followed by all of row 2, and so on, then
reshape(TheMatrix.',[],1)