User`s guide

Using Class Methods
char[] chArray2 = {'W', 'o', 'r', 'l', 'd'};
MWCharArray A = new MWCharArray(chArray1);
System.out.println("The string in MWCharArray1 is \"" + A + "\"");
Construct a second MWCharArray from a String object:
String str = new String(chArray2);
MWCharArray A2 = new MWCharArray(str);
System.out.println("The string in MWCharArray2 is \"" +
A2 + "\"");
When run, the example displays this output:
The string in MWCharArray1 is "Hello"
The string in MWCharArray2 is "World"
Methods to Create and Destroy an MWCharArray
In addition to the MWCharArray constructor, you can use the newInstance
method to construct a character array. This method offers better p erformance
than using the class constructor. To destroy the array, use either
dispose
or disposeArray.
Method Description
“newInstance”
on page 4-109
Constructs a char array wi t h the specified dimension s.
“dispose” on
page 4-110
Frees the native M ATLAB array contained by this array.
“disposeArray”
on page 4-111
Frees all native MATLAB arrays contained in the input
object.
newInstance. T his method constructs a char array with the specified
dimensions and initializes the array w ith the supplied data. The input array
must be of type
char[] or java.lang.String. The characters in the array
are assumed to be stored in column-major orde r.
4-109