MATLAB BUILDER JA 2 Uživatelská příručka Strana 141

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 292
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 140
Using Class Methods
short[]
byte[]
boolean[]
One-dimensional arrays of any subclass of java.lang.Number
One-dimensional arrays of java.lang.Boolean
Exceptions
The newInstance method throws the following exceptions:
NegativeArraySizeException
The specified dims para m eter is negative.
ArrayStoreException
Thearraytypeisnonnumeric.
Example Constructing a Numeric Array Object with newInstance
Construct a 3-by-6 real numeric array using the newInstance method. Note
that data in the Java array must be stored in column-wise order so that it will
be in the correct order in the final
MWNumericArray object.
int[] dims = {3, 6};
double[] Adata = { 1, 7, 13,
2, 8, 14,
3, 9, 15,
4, 10, 16,
5, 11, 17,
6, 12, 18};
MWNumericArray A =
MWNumericArray.newInstance(dims, Adata, MWClassID.DOUBLE);
System.out.println("A = " + A);
4-65
Zobrazit stránku 140
1 2 ... 136 137 138 139 140 141 142 143 144 145 146 ... 291 292

Komentáře k této Příručce

Žádné komentáře