MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER User Manual Page 204

  • Download
  • Add to my manuals
  • Print
  • Page
    / 408
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 203
5 Calling Java from MATLAB
5-34
Creating an Array of Objects Within MATLAB
To call a Java method that has one or more arguments defined as an array of
Java objects, you must, under most circumstances, pass your objects in a Java
array. You can construct an array of objects in a call to a Java method or
constructor. Or you can create the array within MATLAB.
The MATLAB
javaArray function lets you create a Java array structure that
can be handled in MATLAB as a single multidimensional array. You specify
the number and size of the array dimensions along with the class of objects you
intend to store in it. Using the one-dimensional Java array as its primary
building block, MATLAB then builds an array structure that satisfies the
dimensions requested in the
javaArray command.
Using the javaArray Function
To create a Java object array, use the MATLAB javaArray function, which has
the following syntax.
A = javaArray('element_class', m, n, p, ...)
The first argument is the ’element_class’ string, which names the class of the
elements in the array. You must specify the fully qualified name (package and
class name). The remaining arguments (
m, n, p, ...) are the number of
elements in each dimension of the array.
An array that you create with
javaArray is equivalent to the array that you
would create with the Java code.
A = new element_class[m][n][p]...;
The following command builds a Java array of four lower level arrays, each
capable of holding five objects of the
java.lang.Double class. (You will
probably be more likely to use primitive types of
double than instances of the
java.lang.Double class, but in this context, it affords us a simple example.)
dblArray = javaArray('java.lang.Double', 4, 5);
The javaArray function does not deposit any values into the array elements
that it creates. You must do this separately. The following MATLAB code
stores objects of the
java.lang.Double type in the Java array dblArray that
was just created.
Page view 203
1 2 ... 199 200 201 202 203 204 205 206 207 208 209 ... 407 408

Comments to this Manuals

No comments

Energizer CAPW2BODE manuali

Manuali dei proprietari e guide per l'utente per Torce Energizer CAPW2BODE.
We fornisce 1 manuali pdf Energizer CAPW2BODE per scaricare gratuitamente in base al tipo di documento: Scheda Tecnica


Energizer CAPW2BODE Scheda Tecnica (1 pagine)


Marchio: Energizer | Categoria: Flashlights | Dimensione: 0.07 MB |

 




Più prodotti e manuali per Torce Energizer

Modelli Tipo di Documento
SOLRE35BP Scheda Tecnica   Energizer Solar Folding Lantern, 1 pagine
HD33A2ODE Scheda Tecnica   Energizer HD33A2ODE flashlight, 1 pagine
SOLCKCCBP Scheda Tecnica   Energizer Solar Carabiner Crank Light, 1 pagine
CAPR22ODE Scheda Tecnica   Energizer CAPR22ODE flashlight, 1 pagine
ECAP1AAE Scheda Tecnica   Energizer ECAP1AAE flashlight, 1 pagine
CAPG2BODE Scheda Tecnica   Energizer CAPG2BODE flashlight, 1 pagine
631637 Scheda Tecnica   Energizer Pro-Headlight 4 LED, 1 pagine
MILMOS11L Scheda Tecnica   Energizer MILMOS11L flashlight, 1 pagine
FL452WRH Scheda Tecnica   Energizer FL452WRH flashlight, 1 pagine
PLED34AE Scheda Tecnica    Energizer PLED34AE flashlight, 1 pagine
ELMCL11L Scheda Tecnica   Energizer ELMCL11L flashlight, 1 pagine
HD3LMS32E Scheda Tecnica   Energizer 3 LED Micro Sport Headlight, 1 pagine
3151LS Scheda Tecnica   Energizer 3151LS flashlight, 1 pagine
RCL1NM2WR Scheda Tecnica   Energizer RCL1NM2WR flashlight, 1 pagine
KCC2BODBP Scheda Tecnica   Energizer KCC2BODBP flashlight, 1 pagine
WRCLD41E Scheda Tecnica   Energizer WRCLD41E flashlight, 1 pagine
631638 Scheda Tecnica   Energizer Pro-Headlight 7 LED, 1 pagine
625702 Scheda Tecnica   Energizer Hi-Tech LED 2 in 1, 1 pagine
625701 Scheda Tecnica   Energizer Penlight, 1 pagine
632026 Scheda Tecnica   Energizer ENATEX, 1 pagine