Call MATLAB function, user-defined function, or MEX-file and capture error information
#include "mex.h" mxArray *mexCallMATLABWithTrap(int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[], const char *functionName);
#include "fintrf.h" mwPointer mexCallMATLABWithTrap(nlhs, plhs, nrhs, prhs, functionName) integer*4 nlhs, nrhs mwPointer plhs(*), prhs(*) character*(*) functionName
For more information about arguments, see mexCallMATLAB
.
nlhs
Number of desired output arguments.
plhs
Array of pointers to output arguments.
nrhs
Number of input arguments.
prhs
Array of pointers to input arguments.
functionName
Character string containing the name of the MATLAB® built-in function, operator, function, or MEX-file that you are calling.
NULL
if no error occurred; otherwise, a pointer
to an mxArray
of class MException
.
The mexCallMATLABWithTrap
function performs
the same function as mexCallMATLAB
. However,
if MATLAB detects an error when executing functionName
, MATLAB returns
control to the line in the MEX-file immediately following the call
to mexCallMATLABWithTrap
. For information about MException
,
see Respond to an Exception