MATLAB BUILDER JA 2 User's Guide Page 41

  • Download
  • Add to my manuals
  • Print
  • Page
    / 292
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 40
How Does MATLAB Builder for Java H andle Data?
Understanding MATLAB Function Signatures
As background, recall that the generic MATLAB function has the following
structure:
function [Out1, Out2, ..., varargout]=foo(In1, In2, ..., varargin)
To the left of the equal sign, the function specifies a set of explicit and optional
return arguments.
To the right of the equal sign, the function lists explicit input arguments
followed by one or more optional arguments.
Each argument represents a MATLAB type. When you include the
varargin
or varargout argument, you can specify an arbitrary number of inputs or
outputs beyond the ones that are explicitly declared.
Overloaded Methods in Java That Encapsulate M-Code
When MATLAB B uilde r for Java encapsulates your M-code, it creates a set of
overloaded methods that implement the MATLAB functions. Each of these
overloaded methods corresponds to a call to the generic MATLAB function for
each combination of the possible number and type of input arguments.
In addition to these m ethods encapsulating input arguments, Java Builder
creates another method, which represents the output arguments, or return
values, of the MATLAB function. This additional overloaded method takes
care of return values for the encapsulated MATLAB function. This method
of encapsu lating the in formation about return values simulates the
mlx
interface in the MATLAB Compiler.
These overloaded methods are called the standard interface (encapsulating
input arguments) and the m lx interface (encapsulating return values). See
“Programming Interfaces Generated by JavaBuilder”onpage6-14fordetails.
ReturningDatafromMATLABtoJava
All data returned from a method coded in MATLAB is passed as an instance
of the appropriate
MWArray subclass. For example, a MATLAB cell a rray is
returned to the Java application as a n
MWCellArray object.
2-7
Page view 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 291 292

Comments to this Manuals

No comments