User`s guide
Interfacing M-Code to C/C++ Code
5-49
callback that references the specified function. Without this pragma, the -h
option will not be able to locate and compile all M-files used in your application.
If you are using the
%#function pragma to define functions that are not
available in M-code, you must write a dummy M-function that identifies the
number of input and output parameters to the M-file function with the same
name used on the
%#function line. For example:
%#function myfunctionwritteninc
This implies that myfunctionwritteninc is an M-function that will be called
using
feval. The Compiler will look up this function to determine the correct
number of input and output variables.
Compiling MEX-Files
If the Compiler finds both a function M-file and a .mex file in the same
directory, it will assume that the
.mex file is the compiled version of the M-file.
In those cases, if the M-file version is not desired, use the
%#mex pragma to force
the Compiler to use the MEX-file. For example:
function y = gamma(x)
%#mex
error('gamma MEX-file is missing');