MATLAB BUILDER JA 2 Podręcznik Użytkownika Strona 39

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 38
How Does MATLAB Builder for Java H andle Data?
Overview of Classes and Methods in the Data Conversion
Class Hierarchy
The root of the data conversion class hierarchy is the MWArray abstract
class. The
MWArray class has the following subclasses representing the
major MATLAB types:
MWNumericArray, MWLogicalArray, MWCharArray,
MWCellArray,andMWStructArray.
Each subclass stores a reference to a native MATLAB array of that type.
Each class provides constructors and a basic set of methods for accessing
the underlying array’s properties and data. To be specific,
MWArray and the
classes derived from
MWArray pr ovide t he following:
Constructors and finalizers to instantiate and dispose of MATLAB arrays
get and set methods to read and write the array data
Methods to identify p roperties of the array
Comparison methods to test the equality or order of the array
Conversion methods to convert to other data types
Advantage of Using Data Conversion Classes
The MWArray data convers ion classes let you p ass native type p arameters
directly without using explicit data conversion. If y ou pass the same array
frequently, you might improve the performance of your program by storing
the array in an instance of one of the
MWArray subclasses.
Automatic Conversion to MATLAB Types
Note Because the conve rsio n process is a utomatic (in most cases), you do not
need to understand the conversion process to pass and return arguments with
MATLAB Builder for Java components.
When you pass an MWArray instan ce as an inp ut argument, the encapsu lated
MATLABarrayispasseddirectlytothemethodbeingcalled.
In contrast, if your code uses a native Java primitive or array as an input
parameter, Java Builder converts it to an instance of the appropriate
MWArray
2-5
Przeglądanie stron 38
1 2 ... 34 35 36 37 38 39 40 41 42 43 44 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag