MATLAB BUILDER JA 2 Guía de usuario Pagina 179

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 292
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 178
Using Class Methods
Inthecasewhereindex is of type int[],eachelementoftheindex vector
is an index along one dimension of the
MWLogicalArray object. The valid
range for any index is
1 <= index[i] <= N[i],whereN[i] is the size of the
ith dimension.
Exceptions
The set method throws the following exception:
IndexOutOfBoundsException
The specified index parameter is invalid.
Example—SettingaValueinaLogicalArray
Get and modify the value at A(2,3):
boolean[][] Adata = {{true, false, false},
{false, true, false}};
MWLogicalArray A = new MWLogicalArray(Adata);
int[] index = {2, 3};
Object d_out = A.get(index);
System.out.println("Array element A(2,3) is " +
d_out.toString() + "\n");
System.out.println("Setting A(2,3) to true\n");
A.set(index, true);
d_out = A.get(index);
System.out.println("Array element A(2,3) is " +
d_out.toString() + "\n");
When run, the example displays this output:
Array element A(2,3) is false
4-103
Vista de pagina 178
1 2 ... 174 175 176 177 178 179 180 181 182 183 184 ... 291 292

Comentarios a estos manuales

Sin comentarios