本文共 1015 字,大约阅读时间需要 3 分钟。
原文:
Syntax
#include "mex.h"int mexCallMATLAB(int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[], const char *name);
Arguments
nlhs - Number of desired output arguments. This value must be less than or equal to 50.
plhs - Array of pointers to mxArrays. The called command puts pointers to the resultant mxArrays into plhs and allocates dynamic memory to store the resultant mxArrays. By default, MATLAB automatically deallocates this dynamic memory when you clear the MEX-file. However, if heap space is at a premium, you may want to call mxDestroyArray as soon as you are finished with the mxArrays that plhs points to.
nrhs - Number of input arguments. This value must be less than or equal to 50.
prhs - Array of pointers to input arguments.
name - Character string 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, '+'.
Returns
0 if successful, and a nonzero value if unsuccessful.
转载地址:http://rxhai.baihongyu.com/