MATLAB BUILDER JA 2 Podręcznik Użytkownika Strona 132

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 131
1 2 ... 127 128 129 130 131 132 133 134 135 136 137 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag