MATLAB BUILDER JA 2 Betriebsanweisung Seite 86

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 292
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 85
4 Using MWArra y Classes
New Integer(2), MWClassID.INT32);
MWNumericArray a4 = new MWNumericArray("1.0", "2.0",
MWClassID.INT32);
Constructing Matrices
The next group of statements constructs a 2-by-2 double matrix with the
following values:
[1 2
34]
double[][] x1 = {{1.0, 2.0}, {3.0, 4.0}};
int[][] x2 = {{1, 2}, {3, 4}};
Double[][] x3 = {{new Double(1.0), new Double(2.0)},
{new Double(3.0), new Double(4.0)}};
String[][] x4 = {{"1.0", "2.0'}, {"3.0", "4.0"}};
MWNumericArray a1 = new MWNumericArray(x1, MWClassID.DOUBLE);
MWNumericArray a2 = new MWNumericArray(x2, MWClassID.DOUBLE);
MWNumericArray a3 = new MWNumericArray(x3, MWClassID.DOUBLE);
MWNumericArray a4 = new MWNumericArray(x4, MWClassID.DOUBLE);
Constructing N-Dimensional Arrays
The MWNumericArray constructors also support multidimensional arrays of all
supported types. For example, you can construct a 2-by-3-by-2
double array
with the following two statements:
Double[][][] x1 = {
{{ 1.0, 2.0, 3.0},
{ 4.0, 5.0, 6.0}},
{{ 7.0, 8.0, 9.0},
{10.0, 11.0, 12.0}}
};
MWNumericArray a1 = new MWNumericArray(x1);
4-10
Seitenansicht 85
1 2 ... 81 82 83 84 85 86 87 88 89 90 91 ... 291 292

Kommentare zu diesen Handbüchern

Keine Kommentare