MATLAB BUILDER JA 2 Guide de l'utilisateur Page 99

  • 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 98
Guidelines for Working with MWArray Classes
These examples construct a scalar logical array initialized to false:
MWLogicalArray a1 = new MWLogicalArray(false);
MWLogicalArray a2 = new MWLogicalArray(0);
MWLogicalArray a3 = new MWLogicalArray("false");
MWLogicalArray a4 = new MWLogicalArray(new Boolean(false));
As with MWNumericArray, MWLogicalArrays can be constructed with
multidimension al Java arrays. Here are some examples:
boolean[][] x1 = {{true, false}, {false, true}};
int[][] x2 = {{1, 0}, {0, 1}};
Boolean[][] x3 = {{new Boolean(true), new Boolean(false)},
{new Boolean(false), new Boolean(true)}};
String[][] x4 = {{"true", "false"},
{"false", "true"}};
boolean[][][] x5 = {
{{ true, false, true},
{ false, true, false}},
{{ true, false, true},
{ false, true, false}}
};
MWLogicalArray a1 = new MWLogicalArray(x1);
MWLogicalArray a2 = new MWLogicalArray(x2);
MWLogicalArray a3 = new MWLogicalArray(x3);
MWLogicalArray a4 = new MWLogicalArray(x4);
MWLogicalArray a5 = new MWLogicalArray(x5);
Using Static Factory Methods to Create MWLogicalArrays
The following table lists the static factory methods of MWLogicalArray.
Factory Method Usage
newInstance(int[])
New logical array. Values are
initialized to
false.
4-23
Vue de la page 98
1 2 ... 94 95 96 97 98 99 100 101 102 103 104 ... 291 292

Commentaires sur ces manuels

Pas de commentaire