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 March 19, 2024, 3:05 a.m.