FUNCTION REFERENCE
nonzeros
Nonzero elements as a column.
Nonzero elements as a column.
Syntax
v = nonzeros(A)Returns the nonzero elements of A in column order as a column vector,
0-by-1 when there are none. For a sparse array these are its stored values, as a full column.
Example
nonzeros([1 0 2; 0 3 0]) % [1; 3; 2]Example
nonzeros(sparse([0 4; 5 0])) % [5; 4]Differences from MATLAB: none known.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.