MATLAB BUILDER JA 2 Podręcznik Użytkownika Strona 100

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 99
1 2 ... 95 96 97 98 99 100 101 102 103 104 105 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag