MATLAB Application Program Interface Reference | Help Desk |
mexFunction
MATLAB entry point to a Fortran MEX-file
subroutine mexFunction(nlhs, plhs, nrhs, prhs) integer*4 nlhs, nrhs, plhs(*), prhs(*)nlhs
The number of expected outputs.
plhsArray of pointers to expected outputs.
nrhs prhs
Array of pointers to input data. The input data is read only and should not be altered by your mexFunction
.
nlhs
, plhs
, nrhs
, and prhs
with the caller's information. In the syntax of the MATLAB language, functions have the general form
[a,b,c,] = fun(d,e,f,)where the
denotes more items of the same format. The a,b,c
are left-hand side arguments and the d,e,f
are right-hand side arguments. The arguments nlhs
and nrhs
contain the number of left-hand side and right-hand side arguments, respectively, with which the MEX-function is called. prhs
is an array of mxArray
pointers whose length is nrhs
. plhs
is a pointer to an array whose length is nlhs
, where your function must set pointers for the returned left-hand side mxArrays
.