MATLAB BUILDER JA 2 Guía de usuario Pagina 134

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 292
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de 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
Vista de pagina 133
1 2 ... 129 130 131 132 133 134 135 136 137 138 139 ... 291 292

Comentarios a estos manuales

Sin comentarios