User`s guide
4 Using MWArra y Classes
System.out.println("Data read from cell array C: \n");
MWArray[] x = (MWArray[]) C.getData();
for (int i = 0; i < x.length; i++)
System.out.println(x[i]);
System.out.println();
When run, the example displays this output:
Data read from cell array C:
0
0
0
set. This method replaces the element at the specified one-base d offset in this
array with t he specified element. The
set m ethod of MWCellArray overrides
the
set method of class MWArray.
To get the element at a specific index, use one of the following:
public void set(int index, Object element)
public void set(int[] index, Object element)
Use the first syntax (int index) to return the ele ment at the specified
one-based offset in the a rray, accessing elements in column-wise order. Us e the
second syntax (
int[] index) to return the element at the specified array of
one-based indices. The first syntax offers better performance than the second.
Input Parameters
element
New element to replace at index
If
element is of type MWArray,thecellatindex is set to a shared copy of the
underlying MATLAB array. Otherwise, a new MATLAB array is created from
element using d efault conversion rules and assigned to the cell at index.
4-144