MATLAB Compiler    

C++ Interface Functions

The C++ interface functions process any input arguments and pass them to the implementation version of the function.

mlxF Interface Function

The Compiler always generates the mlxF interface function, which is used by feval. At times, the Compiler needs to use feval to perform argument matching even if the user does not specifically call feval. For example,

would use the feval interface. The following C++ code is the corresponding feval interface (mlxGasket) from the Sierpinski Gasket example. This function calls the C++ Mgasket function:

F Interface Function

The Compiler always generates the F interface function, which contains the "normal" C++ interface to the function. This code is the corresponding C++ interface function (gasket) from the Sierpinski Gasket example. This function calls the C++ code:

NF Interface Function

The Compiler produces this interface function only when the M-function uses the variable nargout. The nargout interface allows the number of requested outputs to be specified via the nargout argument, as opposed to the normal interface that dynamically calculates the number of outputs based on the number of non-NULL inputs it receives.

This is the corresponding NF interface function (NFoo) for the foo.m example described earlier in this chapter. This function calls the Mfoo function appearing in foo.cpp:

VF Interface Function

The Compiler produces this interface function only when the M-function uses the variable nargout and has at least one output. The void interface function specifies zero output arguments to the implementation version of the function, and in the event that the implementation version still returns an output (which, in MATLAB, would be assigned to the ans variable), it deallocates the output.

This is the corresponding VF interface function (VFoo) for the foo.m example described earlier in this chapter. This function calls the Mfoo function appearing in foo.cpp:


  C Interface Functions Supported Executable Types