1 #include "mex.h" 2 3 void mexFunction(int nlhs,mxArray * plhs[],int nrhs,const mxArray * prhs[])4mexFunction (int nlhs, mxArray *plhs[], 5 int nrhs, const mxArray *prhs[]) 6 { 7 const char *nm; 8 9 nm = mexFunctionName (); 10 mexPrintf ("You called function: %s\n", nm); 11 if (strcmp (nm, "myfunc") == 0) 12 mexPrintf ("This is the principal function\n", nm); 13 14 return; 15 } 16