collapse_matrix function

Collapse the matrices of a matlist object