MATLAB BUILDER JA 2 Guide de l'utilisateur Page 134

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 292
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 133
1 2 ... 129 130 131 132 133 134 135 136 137 138 139 ... 291 292

Commentaires sur ces manuels

Pas de commentaire