nzmax
Storage allocated for non-zero elements.
Syntax
Section titled “Syntax”n = nzmax(X)Description
Section titled “Description”Returns the amount of storage allocated for non-zero entries in X — for sparse matrices, this is >= nnz(X). Useful for diagnosing whether further insertions will trigger a reallocation.
Examples
Section titled “Examples”S = spalloc(100, 100, 500);nzmax(S) % 500nnz(S) % 0 (allocated but unused)