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

  • 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 112
Guidelines for Working with MWArray Classes
index[1] = 2;
double[][] x12 = (double[][])a.get(index);
index[0] = 2;
boolean[][] x22 = (boolean[][])a.get(index);
index[1] = 1;
int[][] x21 = (int[][])a.get(index);
As with set, default conversion rules are applied(samerulesasapplyto
toArray). In this example, the default rules are fine. In the case where
complex arrays, other cell arrays, or struct a rrays are stored in the cell array,
it is recommended to use
getCell to return an MWArray insta n ce.
toArray and getData Methods
In addition to get and getCell,thetoArray and getData methods are
implemented o n
MWCellArray to return a conversion of the entire cell array.
These methods provide a bulk conversion to an array of Java arrays, although
the output can be difficult to dissect in some cases (particularly in the case
of nested cell arrays).
The
getData method returns a one-dimensional array o f type Object.Each
element of the return cell array is converted by calling
toArray on the
corresponding cell.
The
toArray method returns the same array, except that it has the same
dimensionality as the underlying cell array.
4-37
Zobrazit stránku 112
1 2 ... 108 109 110 111 112 113 114 115 116 117 118 ... 291 292

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

Žádné komentáře