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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 170
Using Class Methods
Exceptions
The newInstance method throws the following exceptions:
NegativeArraySizeException
The specified dims para m eter is negative.
ArrayStoreException
The specified data is nonnumeric or non-Boolean.
Example Constructing a Logical Array Object w ith newInstance
Construct a 1-by-5 logical array using the newInstance method. Note that
data in the Java array must be stored in a column-wise order so that it will be
in row-wise order in the final
MWLogicalArray object.
boolean[] Adata = { true, true, false, false, true};
int[] dims = {1, 5};
MWLogicalArray A = MWLogicalArray.newInstance(dims, Adata);
System.out.println("Array A: " + A.toString());
When run, the example displays this output:
Array A: 1 1 0 0 1
newSparse. This method constructs a sparse MWLogicalArray with the
specified number of rows and columns and m aximum nonzero elements, and
initializes the array with the supplied data. This is a static method of the class
and thus does no t need to be invoked in reference to an instance of the class.
Supported Prototypes
Supported prototypes for newSparse are as follows. All input parameters
shown here are described under Input Parameters on page 96. Any
parameters not specified are given their default values.
4-95
Przeglądanie stron 170
1 2 ... 166 167 168 169 170 171 172 173 174 175 176 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag