MATLAB BUILDER JA 2 Guida Utente Pagina 134

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 292
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 133
4 Using MWArra y Classes
Example Getting the Maximum Number of Nonzeros in an
MWArray
Display the maximum number of nonzeros for this array:
System.out.println("Maximum number of nonzeros for matrix A is "
+ A.maximumNonZeros());
When run, the example displays this output:
Maximum number of nonzeros for matrix A is 10
numberOfNonZeros. This method returns the number of nonzero elements
in a sparse array. If the underlying array is nonsparse, this method returns
the same value as
numberOfElements.
The prototype for the
numberOfNonZeros method is as follows:
public int numberOfNonZeros()
Input Parameters.
None
Example Getting the Number of Nonzeros in an MWArray
Display the number of nonzero values in this array:
System.out.println("The number of nonzeros for matrix A is " +
A.numberOfNonZeros());
When run, the example displays this output:
The number of nonzeros for matrix A is 5
Using MWNumericArray
This section cov ers the following topics:
“Constructing an MWNumericArray” on page 4-59
4-58
Vedere la pagina 133
1 2 ... 129 130 131 132 133 134 135 136 137 138 139 ... 291 292

Commenti su questo manuale

Nessun commento