The COLVEC function converts a matrix into a column vector. If matrix is any matrix, the COLVEC function returns an vector that contains the elements of matrix in row-major order. The first elements in the vector correspond to the first row of the input matrix, the next elements correspond to the second row, and so on, as shown in the following example.
x = {1 2 3, 4 5 6}; y = colvec(x); print y;