Nonzero Elements
Number of non-zero elements.
nnz(x)
x
a numeric or complex vector or matrix.
the number of non-zero elements of x.
find
nnz(diag(10))
Practical Numerical Math Functions
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.