User`s guide

4 Using MWArra y Classes
Method Description
“numberOfDimensions” on
page 4-123
Returns the number o f dimensions of this
array.
“numberOfElements” on
page 4-123
Returns the total number of elements in this
array.
“numberOfFields” on page
4-123
Returns the number of fields in this array.
classID. This m ethod returns the MATLAB type of this array. The classID
method of MWStructArray overrides the classID method of class MWArray.
The prototype for the
classID method is
public MWClassID classID()
Input Parameters
None
Example Getting the Class ID of a Structure Array
Create an MWStructArray object and display the class ID:
int[] sdims = {1, 2};
String[] sfields = {"f1", "f2", "f3"};
MWStructArray S = new MWStructArray(sdims, sfields);
System.out.println("The class of S is " + S.classID());
When run, the example displays this output:
The class of S is struct
fieldNames. This method returns the field names in this array.
The prototype for the
fieldNames method is
4-122