Generic slice for sparse matrices