MATLAB BUILDER JA 2 Guida Utente Pagina 162

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 292
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 161
4 Using MWArra y Classes
Exceptions
These methods throw the following exception:
IndexOutOfBoundsException
The specified index parameter is invalid.
toImagArray. This method returns an array containing a copy of the
imaginary data in the underlying MATLAB array.
The prototype for the
toImagArray method is
public Object toImagArray()
The array that is returned has the same dimensionality as the MATLAB array.
The elements of this array are converted according to default conversion rules.
Input Parameters
None
Example Getting Complex Data with toImagArray
Using the same array as in the example for “getImag” on pag e 4-81, get and
display a copy of the imaginary part of that array:
double[][] x = (double[][]) A.toImagArray();
int[] dimA = A.getDimensions();
System.out.println("The imaginary part of matrix A is:");
for (int i = 0; i < dimA[0]; i++)
{
for (int j = 0; j < dimA[1]; j++)
System.out.print(" " + x[i][j]);
System.out.println();
}
4-86
Vedere la pagina 161
1 2 ... 157 158 159 160 161 162 163 164 165 166 167 ... 291 292

Commenti su questo manuale

Nessun commento