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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 123
4 Using MWArra y Classes
Exceptions
The set method throws the following exception:
IndexOutOfBoundsException
The specified index parameter is invalid.
Example Setting an MWArray Value
Modify the data in element (2, 4)ofMWArray object A:
int[] index = {2, 4};
A.set(index, 555);
Object d_out = A.get(index);
System.out.println("Data read from A(2,4) is " +
d_out.toString());
When run, the example displays this output:
Data read from A(2,4) is 555
toArray. This method creates an array with t he same dimensionality as the
MATLAB array.
The prototype for the
toArray method is as fo llows:
public Object[] toArray()
The elements of the returned array are converted according to default
conversion rules. If the underlying MATLAB array is a complex numeric
type,
toArray returns the real part.
Input Parameters
None
4-48
Przeglądanie stron 123
1 2 ... 119 120 121 122 123 124 125 126 127 128 129 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag