MATLAB BUILDER JA 2 Guide de l'utilisateur Page 179

  • 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 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
Vue de la page 178
1 2 ... 174 175 176 177 178 179 180 181 182 183 184 ... 291 292

Commentaires sur ces manuels

Pas de commentaire