MATLAB Compiler    

C Interface Functions

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

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.

mlfF Interface Function

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

mlfNF Interface Function

The Compiler produces this interface function only when the M-function uses the variable nargout.The nargout interface allows you to specify the number of requested outputs via the int 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 mlfNF interface function (mlfNFoo) for the foo.m example described earlier in this chapter. This function calls the Mfoo function that appears in foo.c:

mlfVF Interface Function

The Compiler produces this interface function only when the M-function uses the variable nargout and has at least one output. This 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 mlfVF interface function (mlfVFoo) for the foo.m example described at the beginning of this section. This function calls the C Mfoo implementation function that appears in foo.c:


  Internal Interface Functions C++ Interface Functions