sparse
Create codistributed sparse matrix
Description
converts
a full codistributed matrix to sparse form by removing any zero elements. You can save
memory by converting a matrix that contains many zeros to sparse storage.S
= sparse(A
)
creates
an S
= sparse(m,n
)m
-by-n
codistributed sparse matrix of all
zeros.
creates a codistributed sparse matrix S
= sparse(i,j
,v
)S
from the triplets
i
, j
, and v
. The number of rows
in S
is set by the maximum value of i
, and the
number of columns in S
is set by the maximum value of
j
. The matrix has space allotted for length(v)
nonzero elements.
Each of the inputs i
, j
, and
v
must have either 1
or N
elements, such that each non-scalar input has the same number of elements.
Examples
Input Arguments
Version History
Introduced in R2006b