MATLAB BUILDER JA 2 Guide de l'utilisateur Page 100

  • 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 99
4 Using MWArra y Classes
Factory Method Usage
newInstance(int[], Object)
New logical array. Values are
initialized with supported data.
newSparse(int[], int[],
Object, int, int, int)
Sparse logical matrix of specified
dimensions and maximum nonzeros.
Values are initialized with supplied
row, column, and data arrays.
newSparse(int[], int[],
Object, int, int)
Sparse logical matrix of specified
dimensions. Values are initialized
with supplied row, column, and data
arrays. Maximum nonzeros are
computed from input data.
newSparse(int[], int[],
Object)
Sparse logical matrix. Values
are initialized with supplied row,
column, and data arrays. Maximum
nonzeros and dimensions are
computed from input data.
newSparse(Object)
Sparse logical matrix. Values are
initialized from supplied full matrix.
These m ethods all return a new MWLogicalArray instance constructed from
the input information. You can use these methods to construct and initialize
an array w ith supplied data, or to construct an array of a specified size
and initialize all values to
false. The main difference is that, exception
for the last
newSparse method, data is supplied to the factory methods in
one-dimensional a rrays with the data arranged in column-wise order.
The following examples rewrite the two-dimensional array constructor
examples using
newInstance:
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"};
int[] dims = {2, 2};
4-24
Vue de la page 99
1 2 ... 95 96 97 98 99 100 101 102 103 104 105 ... 291 292

Commentaires sur ces manuels

Pas de commentaire