
 Usage

Returns the number of nonzero elements in a matrix. The
general format for its use is

     y = nnz(x)

This function returns the number of nonzero elements in a
matrix or array. This function works for both sparse and
non-sparse arrays. For


 Example


  --> a = [1,0,0,5;0,3,2,0]

  a =
   1 0 0 5
   0 3 2 0

  --> nnz(a)

  ans =
   4

  --> A = sparse(a)

  A =
   1 1 1
   2 2 3
   2 3 2
   1 4 5
  --> nnz(A)

  ans =
   4


* FreeMat_Documentation
* Inspection_Functions
* Generated on Thu Jul 25 2013 17:17:38 for FreeMat by
  doxygen_ 1.8.1.1

