FUNCTION REFERENCE

nzmax

Storage allocated for nonzeros.

Storage allocated for nonzeros.

Syntax

n = nzmax(S)

For a sparse array MatRust allocates exactly the stored entries, so nzmax(S) equals nnz(S). For a full array it is numel(A).

Example

nzmax(sparse([1 0 2]))   % 2

Differences from MATLAB: MATLAB can report more than nnz(S) after spalloc or sparse(...,nzmax).

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.