nnz

Type: External

Group: matrix

Syntax

answer=NNZ(matrix)

Description

Calculates the number of non zero elements within a matrix.

Examples

NNZ([1,0,2;0,0,5]) = 3