MATLAB BUILDER JA 2 Guía de usuario Pagina 200

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 292
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 199
4 Using MWArra y Classes
public int numberOfFields()
Input Parameters
None
Example Getting the Number of Fields in a Structure Array
Create an MWStructArray object with three fields and display the number
of fields:
int[] sdims = {1, 2};
String[] sfields = {"f1", "f2", "f3"};
MWStructArray S = new MWStructArray(sdims, sfields);
String[] str = S.fieldNames();
System.out.println("There are " + S.numberOfFields() +
" fields in this structure.");
When run, the example displays this output:
There are 3 fields in this structure.
Methods to Get and Set Data in the MWStructArray
Use these methods to get and set v alues in an object of class MWStructArray.
Method Description
“get” on
page 4-125
Returns the element at the specified offset as an Object.
“getData”
on page
4-127
Returns a one-dimensional array containing a copy of the data
in th e und erlying MATLAB array.
4-124
Vista de pagina 199
1 2 ... 195 196 197 198 199 200 201 202 203 204 205 ... 291 292

Comentarios a estos manuales

Sin comentarios