Function that gets the number of columns of a matrix.
Usage is M.get_cols() to get number of columns of M.