MATLAB BUILDER JA 2 Guia do Utilizador Página 132

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 292
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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
Vista de página 131
1 2 ... 127 128 129 130 131 132 133 134 135 136 137 ... 291 292

Comentários a estes Manuais

Sem comentários