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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 199
4 Using MWArra y Classes
public int numberOfFields()
Input Parameters
None
Example Getting the Number of Fields in a Structure Array
Create an MWStructArray object with three fields and display the number
of fields:
int[] sdims = {1, 2};
String[] sfields = {"f1", "f2", "f3"};
MWStructArray S = new MWStructArray(sdims, sfields);
String[] str = S.fieldNames();
System.out.println("There are " + S.numberOfFields() +
" fields in this structure.");
When run, the example displays this output:
There are 3 fields in this structure.
Methods to Get and Set Data in the MWStructArray
Use these methods to get and set v alues in an object of class MWStructArray.
Method Description
“get” on
page 4-125
Returns the element at the specified offset as an Object.
“getData”
on page
4-127
Returns a one-dimensional array containing a copy of the data
in th e und erlying MATLAB array.
4-124
Przeglądanie stron 199
1 2 ... 195 196 197 198 199 200 201 202 203 204 205 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag