User`s guide
4 Using MWArra y Classes
The second example creates a 1-by-2 MWStructArray obje ct with fields f1,
f2,andf3:
int[] sdims = {1, 2};
String[] sfields = {"f1", "f2", "f3"};
MWStructArray S = new MWStructArray(sdims, sfields);
System.out.println("Structure array S: " + S);
When run, the example displays this output:
Structure array S: 1x2 struct array with fields:
f1
f2
f3
Methods to Destroy an MWStructArray
To destroy the arrays, use either dispose or disposeArray.
Method Description
“dispose” on
page 4-120
Frees the native MATLAB array contained by this array.
“disposeArray”
on page 4-121
Frees a ll native MATLAB arrays contained in the input
object.
dispose. The dispose method of MWStructArray overrides the dispose
method of class MWArray.
The prototype for the
dispose method is
public void dispose()
Input Parameters
None
4-120