MATLAB Application Program Interface Reference | Help Desk |
mexCallMATLAB
Call a MATLAB function, a user-defined M-file, or MEX-file
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*(*) namenlhs
Number of desired output arguments. This value must be less than or equal to 50.
plhs
Array of mxArray
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.
Number of input arguments. This value must be less than or equal to 50.
prhsArray of pointers to input data.
name
Character
array containing the name of the MATLAB built-in, operator, M-file, or MEX-file that you are calling. If name
is an operator, just place the operator inside a pair of single quotes; for example, '+'
.
mexSetTrapFlag
was previously called.
Call mexCallMATLAB
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
.
mexFunction
, mexSetTrapFlag