| MATLAB Compiler | ![]() |
int NumberOfNonZeros() const
Return number of nonzero elements for sparse array.
C++ syntax
#include "mclcppclass.h" mwArray a(2, 2, mxDOUBLE_CLASS); int n = a.NumberOfNonZeros();// Should return 4
Arguments
Return value
Actual number of nonzero elements in this array.
Description
Use this method to determine the size of the of the array's data. If the underlying array is not sparse, this returns the same value as NumberOfElements().
| int NumberOfElements() const | int MaximumNonZeros() const | ![]() |
© 1994-2005 The MathWorks, Inc.