Qu

nnz

Builtin index · Core maths

nnz(x)

Input: x · Output: no output

What it is

Number of nonzero elements of a scalar, Vec, Mat or mask: nnz([0, 1, nan, 0, 2]) is 3 (NaN is nonzero, as in MATLAB).

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
nnz(x)
x scalar, Vec, or Matnot documented yet
not documented yetNumber of nonzero elements of a scalar, Vec, Mat or mask: nnz([0, 1, nan, 0, 2]) is 3 (NaN is nonzero, as in MATLAB).

Examples

No documentation example calls this form yet. The Core maths chapter is where one belongs.