User`s guide
Using Class Methods
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
MWNumericArray object. The valid
range for any index is
1 <= index[i] <= N[i],whereN[i] is the size of the
ith dimension.
Exceptions. The se methods throw the following exception:
IndexOutOfBoundsException
The specified index parameter is invalid.
getImag. This method retu rn s the imaginary pa r t of the
MWNumericArray
element located at the specified one- basedindexorindexarray.Thetypeof
the return value is
Object.
Use either of the following prototypes for the
getImag method, where index
can be of type int or int[]:
public Object getImag(int index)
public Object getImag(int[] index)
Example — Getting the Real and Imaginary Parts of an Array
Start by creating a two-dimensional array of complex values:
double[][] Rdata = {{ 2, 3, 4},
{8,9,10},
{14, 15, 16}};
double[][] Idata = {{ 6, 5, 14},
{7,1,23},
{1,1,9}};
MWNumericArray A = new MWNumericArray(Rdata, Idata,
MWClassID.DOUBLE);
System.out.println("Complex matrix A =");
4-81