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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 220
Using Class Methods
index
Index of the requested element in the MWCellArray
In the case where index is of type int, the valid range for index is 1<=index
<= N
,whereN is the total number of elements in the array.
Inthecasewhere
index is of type int[],eachelementoftheindex vector
is an index along one dimension of the
MWCellArray object. The valid range
for any index is
1 <= index[i] <= N[i],whereN[i] isthesizeoftheith
dimension.
Exceptions
The set method throws the following exception:
IndexOutOfBoundsException
The specified index parameter is invalid.
Example Setting Values in a Cell Array
Set the value o f the MWCellArray object C at index (1,3):
int[] cdims = {1, 3};
MWCellArray C = new MWCellArray(cdims);
Integer val = new Integer(15);
int[] index = {1, 3};
C.set(index, val);
Object x = C.get(index);
System.out.println("Cell data C(1,3) is " + x.toString());
When run, the example displays this output:
Cell data C(1,3) is 15
4-145
Przeglądanie stron 220
1 2 ... 216 217 218 219 220 221 222 223 224 225 226 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag