User`s guide
4 Using MWArra y Classes
toString. This method returns a string representation of the array. The
toString method of the MWArray classoverridesthetoString method of
class
Object.
The prototype for the
toString method is as follows:
public java.lang.String toString()
Input Parameters
None
Example — Converting an MWArray to a String
Display the contents of MWArray object A:
System.out.println("A = " + A.toString());
When run, the example displays the contents of A:
A=123456
7 8 9101112
13 14 15 16 17 18
Methods to Use on Sparse MWArrays
Use these methods to return information on sparse arrays of type MWArray or
any of its child classes.
Method Description
“isSparse” on page
4-55
Tests whether the a rray is sparse.
“columnIndex” on page
4-56
Returns an array containing the column index of
each nonzero element in the underlying MATLAB
array.
“rowIndex” on page
4-57
Returns an array containing the row index of each
nonzero e lement in the underlying MATLAB array.
4-54