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

  • 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 218
Using Class Methods
Exceptions
The getCell method throws the following exception:
IndexOutOfBoundsException
The specified index parameter is invalid.
getData. This method returns a one-dimensional array containing a copy
of the data in the underlying MATLAB array. The
getData method of
MWCellArray ov errides the getData method of class MWArray.
The prototype for the
getData method is as fo llows:
public Object getData()
getData
returns a one-dimensional array of e lements stored in column-wise
order. Each element in the returned array is converted to a Java array when
you call
MWArray.toArray() on the corresponding cell.
Input Parameters
None
Example Getting Cell Array Data with getData
Use getData to read data from MWCellArray object C:
int[] cdims = {1, 3};
MWCellArray C = new MWCellArray(cdims);
Integer[] val = new Integer[3];
for(inti=0;i<3;i++)
val[i] = new Integer(i * 15);
for (int i = 1; i <= 3; i++)
C.set(i, val[i-1]);
4-143
Zobrazit stránku 218
1 2 ... 214 215 216 217 218 219 220 221 222 223 224 ... 291 292

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

Žádné komentáře