MATLAB: Can I have array of sparse matrices

sparse

I have array of matrices. Every matrix has only one non-zero element in every row. So I want to save it as array of sparse matrices. How can I do it? sparse(A) where A is array of matrices returns error "Undefined function 'sparse' for input arguments of type 'double' and attributes 'full 3d real'."

Best Answer

You CAN have a cell array of sparse matrices. So every cell may contain a sparse matrix. But you cannot have a sparse 3-d matrix.
Related Question