User`s guide

4 Using MWArra y Classes
Input Parameters
None
Example Testing an MWArray for Sparseness
Test the MWArray object A created previously for sparseness:
if (A.isSparse())
System.out.println("Matrix A is sparse");
When run, the example displays this output:
Matrix A is sparse
columnIndex. This method returns an array containing the column ind ex of
each element in the underlying MATLAB array.
The prototype for the
columnIndex method is as follows:
public int[] columnIndex()
Input Parameters
None
Example Getting the Column Indices of a Sparse MWArray
Get the column indices of the elements of the sparse array:
System.out.print("Column indices are: ");
int[] colidx = A.columnIndex();
for(inti=0;i<5;i++)
System.out.print(colidx[i] + " ");
System.out.println();
When run, the example displays this output:
Column indices are: 1 2 2 5 5
4-56