User`s guide

4 Using MWArra y Classes
Example Cloning a Structure Array Object
Create an MWStructArray object and then a clone of that object:
int[] sdims = {1, 2};
String[] sfields = {"f1", "f2", "f3"};
MWStructArray S = new MWStructArray(sdims, sfields);
Object C = S.clone();
System.out.println("Clone of structure S is:");
System.out.println(C.toString());
When run, the example displays this output:
Clone of structure S is:
1x2 struct array with fields:
f1
f2
f3
compareTo. MWStructArray inherits this method from the MWArray class.
equals.
MWStructArray inherits this method from the MWArray class.
hashCode.
MWStructArray inherits this method from the MWArray class.
sharedCopy. This method creates and returns a shared copy of the
MWStructArray object. The shared copy points to the underlying original
MATLAB array. Any changes made to the copy are reflected in the original.
The
sharedCopy method of MWStructArray overrides the sharedCopy method
of class
MWArray.
The prototype for the
sharedCopy method is
public Object sharedCopy()
4-134