MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manuale Utente Pagina 212

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 408
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 211
5 Calling Java from MATLAB
5-42
can also assign [] to array elements. This stores the NULL value, rather than a
0-by-0 array, in the Java array element.
Subscripted Deletion
When you assign the empty matrix value to an entire row or column of a
MATLAB array, you find that MATLAB actually removes the affected row or
column from the array. In the example below, the empty matrix is assigned to
all elements of the fourth column in the MATLAB matrix,
matlabArray. Thus,
the fourth column is completely eliminated from the matrix. This changes its
dimensions from 4-by-5 to 4-by-4.
matlabArray = [11 12 13 14 15; 21 22 23 24 25; ...
31 32 33 34 35; 41 42 43 44 45]
matlabArray =
11 12 13 14 15
21 22 23 24 25
31 32 33 34 35
41 42 43 44 45
matlabArray(:,4) = []
matlabArray =
11 12 13 15
21 22 23 25
31 32 33 35
41 42 43 45
You can assign the empty matrix to a Java array, but the effect will be
different. The next example shows that, when the same operation is performed
on a Java array, the structure is not collapsed; it maintains its 4-by-5
dimensions.
dblArray(:,4) = []
dblArray =
java.lang.Double[][]:
[125] [125] [125] [] [125]
[250] [250] [250] [] [250]
[375] [375] [375] [] [375]
[500] [500] [500] [] [500]
Vedere la pagina 211
1 2 ... 207 208 209 210 211 212 213 214 215 216 217 ... 407 408

Commenti su questo manuale

Nessun commento