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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 136
Using Class Methods
A nonnumeric array type was specified.
Example Constructing an Integer Array Object
Construct a scalar numeric array of type MWClassID.INT16:
double AReal = 24;
MWNumericArray A = new MWNumericArray(AReal, MWClassID.INT16);
System.out.println("Array A of type " + A.classID() + " = \n" + A);
When you run this example, the results are as follows:
Array A of type int16 =
24
Example Constructing a Complex Array Object
Construct a numeric scalar having real and im aginary parts:
double AReal = 24;
double AImag = 5;
MWNumericArray A = new MWNumericArray(AReal, AImag);
System.out.println("Array A of type " + A.classID() + " = \n" + A);
When you run this example, the results are as follows:
Array A of type double =
24.0000 + 5.0000i
Constructing a Real or Com p lex Nu meric Arra y. Use this constructor
syntax to create a real nonscalar
MWNumericArray from a primitive Java typ e:
MWNumericArray(javatype realValue, MWClassID classid)
OrusethissyntaxtocreateacomplexnonscalarMWNumericArray from a
primitive Java type:
MWNumericArray(javatype realValue, javatype imagValue,
4-61
Przeglądanie stron 136
1 2 ... 132 133 134 135 136 137 138 139 140 141 142 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag