MATLAB BUILDER JA 2 Guida Utente Pagina 132

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 292
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 131
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
Vedere la pagina 131
1 2 ... 127 128 129 130 131 132 133 134 135 136 137 ... 291 292

Commenti su questo manuale

Nessun commento