5864
|
1 #include "mex.h" |
|
2 |
|
3 void |
|
4 mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) |
|
5 { |
|
6 char *str; |
|
7 |
|
8 mexPrintf ("Hello, World!\n"); |
|
9 |
|
10 mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs); |
|
11 |
|
12 if (nrhs < 1 || ! mxIsString (prhs[0])) |
|
13 mexErrMsgTxt ("function name expected"); |
|
14 |
|
15 str = mxArrayToString (prhs[0]); |
|
16 |
|
17 mexPrintf ("I'm going to call the interpreter function %s\n", str); |
|
18 |
|
19 mexCallMATLAB (nlhs, plhs, nrhs-1, prhs+1, str); |
|
20 |
|
21 mxFree (str); |
|
22 } |