MATLAB BUILDER JA 2 Guide de l'utilisateur Page 162

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 292
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 161
1 2 ... 157 158 159 160 161 162 163 164 165 166 167 ... 291 292

Commentaires sur ces manuels

Pas de commentaire