MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manuel d'utilisateur Page 208

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 408
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 207
5 Calling Java from MATLAB
5-38
here, the statement dblArray(2,2:4) refers to a portion of the lower level
array,
dblArray(2). A new array, row2Array, is created from the elements in
columns 2 through 4.
dblArray
dblArray =
java.lang.Double[][]:
[11] [12] [13] [14] [15]
[21] [22] [23] [24] [25]
[31] [32] [33] [34] [35]
[41] [42] [43] [44] [45]
row2Array = dblArray(2,2:4)
row2Array =
java.lang.Double[]:
[22]
[23]
[24]
You also can use the colon operator in single-subscript indexing, as covered in
“Using Single Subscript Indexing to Access Arrays” on page 5-36. By making
your subscript a colon rather than a number, you can convert an array of arrays
into one linear array. The following example converts the 4-by-5 array
dblArray into a 20-by-1 linear array.
linearArray = dblArray(:)
linearArray =
java.lang.Double[]:
[11]
[12]
[13]
[14]
[15]
[21]
[22]
.
.
.
Vue de la page 207
1 2 ... 203 204 205 206 207 208 209 210 211 212 213 ... 407 408

Commentaires sur ces manuels

Pas de commentaire