mexCallMATLABWithTrap (C and Fortran) - Call MATLAB function, user-defined M-file, or MEX-file and capture error information

C Syntax

#include "mex.h"
mxArray *mexCallMATLABWithTrap(int nlhs, mxArray *plhs[], int nrhs,
  const mxArray *prhs[], const char *functionName);

Fortran Syntax

mwPointer mexCallMATLABWithTrap(nlhs, plhs, nrhs, prhs, functionName)
integer*4 nlhs, nrhs
mwPointer plhs(*), prhs(*)
character*(*) functionName

Arguments

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 functionName of the MATLAB built-in, operator, M-file, or MEX-file that you are calling.

Returns

NULL if no error occurred; otherwise, a pointer to an mxArray of class MException.

Description

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 Responding to an Exception

See Also

mexCallMATLAB, MException

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS