sparse
- :
S =sparse(A)¶ - :
S =sparse(m, n)¶ - :
S =sparse(i, j, sv)¶ - :
S =sparse(i, j, sv, m, n)¶ - :
S =sparse(i, j, sv, m, n, "unique")¶ - :
S =sparse(i, j, sv, m, n, nzmax)¶ Create a sparse matrix.
With one argument the full matrix A is converted to sparse storage, dropping zeros. With two arguments an m-by-n matrix of zeros is returned. With the index/value form, element
(i(k), j(k))receivessv(k); scalar arguments are expanded to the common length. Repeated positions are added unless the option"unique"is given, in which case the last value wins. The size defaults to the largest indices.Logical values give a logical sparse matrix, complex values a complex one, and everything else a double one.