| MATLAB Application Program Interface | Search  Help Desk |
| mexCallMATLAB | See Also |
Call a MATLAB function or operator, a user-defined M-file, or other MEX-file
Fortran Syntax
integer*4 function mexCallMATLAB(nlhs, plhs, nrhs, prhs, name) integer*4 nlhs, nrhs, plhs(*), prhs(*) character*(*) nameOn the Alpha and SGI64 platforms, use:
integer*8 function mexCallMATLAB(nlhs, plhs, nrhs, prhs, name) integer*4 nlhs, nrhs integer*8 plhs(*), prhs(*) character*(*) name
Arguments
nlhsmxArray pointers that can be used to access the returned data from the function call. Once the data is accessed, you can then call mxFree to free the mxArray pointer. By default, MATLAB frees the pointer and any associated dynamic memory it allocates when you return from the mexFunction call.
nrhs
Character array containing the name of the MATLAB function, operator, M-file, or MEX-file that you are calling. If name is an operator, place the operator inside a pair of single quotes; for example, '+'.
Returns
0 if successful, and a nonzero value if unsuccessful andmexSetTrapFlag was previously called.
Description
CallmexCallMATLAB to invoke internal MATLAB functions, MATLAB operators, M-files, or other MEX-files.
By default, if name detects an error, MATLAB terminates the MEX-file and returns control to the MATLAB prompt. If you want a different error behavior, turn on the trap flag by calling mexSetTrapFlag.
See Also
mexFunction, mexSetTrapFlag