MATLAB BUILDER JA 2 Podręcznik Użytkownika Strona 134

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 133
1 2 ... 129 130 131 132 133 134 135 136 137 138 139 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag