User`s guide
4 Using MWArra y Classes
MWClassID classid)
The type javatype canbeanyofthefollowing:
•
double
• float
• long
• int
• short
• byte
• boolean
• Object
Example — Constructing a Real Array of a Specific T ype
Construct a 3-by-6 real array of type MWClassID.SINGLE:
double[][] AData = {{ 1, 2, 3, 4, 5, 6},
{ 7, 8 , 9, 10, 11, 12},
{13, 14, 15, 16, 17, 18}};
MWNumericArray A = new MWNumericArray(AData, MWClassID.SINGLE);
System.out.println("Array A = \n" + A);
When run, the example displays this output:
A=123456
7 8 9101112
13 14 15 16 17 18
Example — Constructing a Complex Array of a Specific Type
Construct a 1-by-3 complex array of MWClassID.DOUBLE:
double[] AReal = {24.2, -7, 113};
double[] AImag = {5, 31, 27};
4-62