nnz: Nonzero Elements

View source: R/size.R

nnzR Documentation

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

find

Examples

nnz(diag(10))

pracma documentation built on Nov. 10, 2023, 1:14 a.m.