MATLAB BUILDER JA 2 Guía de usuario Pagina 208

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 292
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 207
4 Using MWArra y Classes
Input Parameters
None
Example Getting Structure Array Data with toArray
int[] sdims = {1, 2};
String[] sfields = {"f1", "f2", "f3"};
MWStructArray S = new MWStructArray(sdims, sfields);
Integer[] val = new Integer[25];
for(inti=0;i<6;i++)
val[i] = new Integer(i * 15);
for(inti=0;i<2;i++)
for (int j = 0; j < sfields.length; j++)
S.set(sfields[j], i+1, val[j + (i * 3)]);
Object[][][] x = (Object[][][]) S.toArray();
System.out.println();
System.out.println("Data read from structure array S \n");
for(intj=0;j<2;j++)
for (int i = 0; i < x.length; i++)
System.out.print(" " + ((int[][]) x[i][0][j])[0][0]);
When run, the example displays this output:
Data read from structure array S
01530456075
Methods to Copy, Convert, and Compare MWStructArrays
Use these methods to copy, convert, and compare objects of class
MWStructArray.
4-132
Vista de pagina 207
1 2 ... 203 204 205 206 207 208 209 210 211 212 213 ... 291 292

Comentarios a estos manuales

Sin comentarios