MATLAB BUILDER JA 2 Uživatelská příručka Strana 200

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 292
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 199
1 2 ... 195 196 197 198 199 200 201 202 203 204 205 ... 291 292

Komentáře k této Příručce

Žádné komentáře