MATLAB BUILDER JA 2 Betriebsanweisung Seite 120

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 292
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 119
4 Using MWArra y Classes
The prototype for the numberOfElements method is as follows:
public int numberOfElements()
Input Parameters
None
Example Getting the Number of MWArray Elements
Display the number of elements in array object A:
System.out.println("Matrix A has " + A.numberOfElements() +
" elements");
When run, the example displays this output:
Matrix A has 18 elements
Methods to Get and Set Data in the MWArray
Use these methods to get and set v alues in an object of class MWArray or any o f
its child classes.
Method Description
“get” on page 4-45 Returns the element at the specified o ne-based
offset or index array as an
Object.
“getData” on page
4-46
Returns a one-dimensional array containing a copy
of the data in the underlying MATLAB array. The
array is in column-wise order.
“set” on page 4-47 Replaces the element at the s pecified o ne -based
offset, or index array, in this array with the s pecified
element.
“toArray” on page
4-48
Returns an array containing a copy of the data in
the underlying MATLAB array. The returned array
has the same dimensionality as the MATLAB array.
4-44
Seitenansicht 119
1 2 ... 115 116 117 118 119 120 121 122 123 124 125 ... 291 292

Kommentare zu diesen Handbüchern

Keine Kommentare