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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 39
2 Concepts
class before it is passed to the method. Java Builder can convert any
Java string, numeric type, or any multidimensional array of these types to
an appropriate
MWArray type, using its data convers ion rules. See “Data
Conversion Rules” on page 6-10 for a list of all the data types that are
supported along with their equ i valent types in MATLAB.
The conversio n rul es ap pl y no t only when calling your own methods, but
also when calling constructors and factory methods belonging to the
MWArray
classes.
Note There are some data types commonly used in MATLAB that are
not available as native Java types. Examples are cell arrays and arrays of
complex numbers. Represent these array types as instances of
MWCellArray
and MWNumericArray,respectively.
Understanding Function Signatures G enerated by
Java Builder
The Java programming language does not support optional function
arguments in the way that MATLAB does with
varargin and varargout.To
support this feature of MATLAB, Java Builde r always generates a basic set
of overlo aded Jav a methods when it encapsulates each MATLAB function.
Each of these overloaded Java methods has the same name as the original
M-function, but has a different number or type of arguments. Each overloaded
function corresponds to one of the possible signatures in MATLAB.
In general, a function with
N input arguments in MATLAB generates N+3
overloaded methods in Java. There is an overloaded method for each input
argument (
N).Theadditionalthreemethodshandle(1)thecaseofnoinput
arguments and (2) the mlx function signature.
Note In addition to handling optional function arguments, the overloaded
Java methods that wrap MATLAB functions handle data conversion. See
“Automatic Conversion to MATLAB Ty pes” on page 2-5 f or more details.
2-6
Przeglądanie stron 39
1 2 ... 35 36 37 38 39 40 41 42 43 44 45 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag