MATLAB BUILDER JA 2 Guide de l'utilisateur Page 219

  • 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 218
Using Class Methods
Exceptions
The getCell method throws the following exception:
IndexOutOfBoundsException
The specified index parameter is invalid.
getData. This method returns a one-dimensional array containing a copy
of the data in the underlying MATLAB array. The
getData method of
MWCellArray ov errides the getData method of class MWArray.
The prototype for the
getData method is as fo llows:
public Object getData()
getData
returns a one-dimensional array of e lements stored in column-wise
order. Each element in the returned array is converted to a Java array when
you call
MWArray.toArray() on the corresponding cell.
Input Parameters
None
Example Getting Cell Array Data with getData
Use getData to read data from MWCellArray object C:
int[] cdims = {1, 3};
MWCellArray C = new MWCellArray(cdims);
Integer[] val = new Integer[3];
for(inti=0;i<3;i++)
val[i] = new Integer(i * 15);
for (int i = 1; i <= 3; i++)
C.set(i, val[i-1]);
4-143
Vue de la page 218
1 2 ... 214 215 216 217 218 219 220 221 222 223 224 ... 291 292

Commentaires sur ces manuels

Pas de commentaire