s = nonzeros(X)
s = nonzeros(X)
is a full column vector of the nonzero elements in X
, ordered by columns.
This gives the s
, but not the i
and j
, from [i,j,s] = find(X)
. Generally,
length(s) = nnz(X) <= nzmax(X) <= prod(size(X))
find
,issparse
,nnz
,nzmax
,size
,whos
(c) Copyright 1994 by The MathWorks, Inc.