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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 138
Using Class Methods
MWNumericArray A =
new MWNumericArray(AReal, AImag, MWClassID.DOUBLE);
System.out.println("Array A of type " + A.classID() + " = \n" + A);
When run, the example displays this output:
Array A of type double =
1.0e+002 *
0.2420 + 0.0500i -0.0700 + 0.3100i 1.1300 + 0.2700i
Methods to C reate and Destroy an MWNumericArray
In addition to the MWNumericArray constructor, you can use the newInstance
and newSparse methods to construct a numeric array. Thes e two methods
offer b etter performance than using the class constructor. To destroy the
arrays, use either
dispose or disposeArray, inherited from class MWArray.
Method Description
“newInstance”
on page 4-63
Constructs an array with the specified dimensions and
complexity.
“newSparse” on
page 4-66
Constructs a real sparse numeric matrix with the
specified number of rows and columns and maximum
nonzero elements, and initializes the array with the
supplied data.
“dispose” o n
page 4-71
Frees the native MATLAB array contained by this array.
“disposeArray”
on page 4-71
Frees all native M ATLAB arrays contained in the input
object.
newInstance. This method constructs a real or complex array, specifying the
array dimensions, type, and complexity. This is a static method of the class
and thus does no t need to be invoked in reference to an instance of the class.
Note This method offers better performance than using the class constructor.
4-63
Przeglądanie stron 138
1 2 ... 134 135 136 137 138 139 140 141 142 143 144 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag