Contents
Previous
Next
Subchapters
Current Chapters->
all
mlmode_all
any
mlmode_any
nnz
equal
fullprec
isempty
isequal
isreal
isnumscalar
ischarmatrix
ischarvector
islogicalscalar
isnummatrix
isnumvector
isfinite
isinf
isnan
islight
isrte
isdeveloper
Parent Chapters->
Omatrix6
elementary
conditions
nnz
Search Tools->
contents
reference
index
search
Number of Nonzero Elements
Syntax
nnz
(
x
)
See Also
any
,
all
,
find
,
equality
Description
Returns the number of element of
x
that are not equal to zero where
x
is a logical, character, integer, real, double-precision or complex matrix.
Example
If you enter
x = identity(5)
nnz(x)
O-Matrix will reply
5