Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nnz

Nonzero Elements


Description

Number of non-zero elements.

Usage

nnz(x)

Arguments

x

a numeric or complex vector or matrix.

Value

the number of non-zero elements of x.

See Also

Examples

nnz(diag(10))

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.