convert a matrix to a list
mat2list(x)
x
the input matrix
a list that contains matrix columns as its elements
x <- matrix(1:15, nrow = 3) mat2list(x)