MATLAB BUILDER JA 2 Guía de usuario Pagina 199

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 292
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 198
Using Class Methods
public java.lang.String[] fieldNames()
Input Parameters
None
Example Getting the Field Names of a Structure Array
Create an MWStructArray object with three fields and display the field names:
int[] sdims = {1, 2};
String[] sfields = {"f1", "f2", "f3"};
MWStructArray S = new MWStructArray(sdims, sfields);
String[] str = S.fieldNames();
System.out.print("The structure has the fields: ");
for (int i=0; i<S.numberOfFields(); i++)
System.out.print(" " + str[i]);
When run, the example displays this output:
The structure has the fields: f1 f2 f3
getDimensions. MWStructArray inherits this method from the MWArray
class.
isEmpty.
MWStructArray inherits this method from the MWArray class.
numberOfDimensions.
MWStructArray inherits this method from the
MWArray class.
numberOfElem ents.
MWStructArray inherits this m ethod from the MWArray
class.
numberOfFields. This method returns the number of fields in this array.
The prototype for the
numberOfFields method is
4-123
Vista de pagina 198
1 2 ... 194 195 196 197 198 199 200 201 202 203 204 ... 291 292

Comentarios a estos manuales

Sin comentarios