User`s guide

Using Class Methods
Method Description
“classID” on page 4-41 Returns the MATLAB type of the array.
“getDimensions” on page 4-42 Returns the size of each dimension of the
array.
“isEmpty” on page 4-42 Tests if the array has no elements.
“numberOfDimensions” on page
4-43
Returns the number of dimensions of the
array.
“numberOfElements” on page
4-43
Returns the total number of elements in
the array.
The e xamples in the fo ll owing secti ons use a 3-by-6 MWNumericArray object
A, as constructed by this Java code:
int[][] 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.INT32);
classID. This m ethod returns the MATLAB type of the MWArray object. The
return typ e is a field defined by the
MWClassID class.
The prototype for the
classID method is as fo llows:
public MWClassID classID()
Input Parameters
None
Example Getting the Class I D of a n MWArray
Return the class ID for an MWNumericArray object created previously:
System.out.println("Class of A is " + A.classID());
4-41