sparse
Sparse matrix definition.
Syntax
sp = sparse(M)
sp = sparse(m, n)
sp = sparse(I, J, V)
sp = sparse(I, J, V, m, n)
sp = sparse(I, J, V, m, n, nz)
Input argument
M - a matrix: double or logical.
m - an integer value: rows dimension.
n - an integer value: columns dimension
I - a vector.
J - a vector.
V - a vector.
nz - an integer value: storage allocation for nonzero elements.
Output argument
S - a single.
Description
sparse is used to build a sparse matrix. Only non-zero entries are stored.
If Mis a full matrix, sparse converts it to a sparse matrix representation, removing all zero values.
If nz is not specified, sparse uses as default value: nz = max([numel(i), numel(j), numel(v)])
If multiple values are specified with the same i, j indices, the associated value will be the sum of the values at the repeated index.
Examples
See also
History
Version | Description |
---|---|
1.0.0 | initial version |
Author
Allan CORNET
Last updated