Mercurial > hg > octave-lyh
diff examples/myfunc.c @ 6580:d2bb3b8a8d20
[project @ 2007-04-25 22:19:03 by dbateman]
author | dbateman |
---|---|
date | Wed, 25 Apr 2007 22:20:28 +0000 |
parents | |
children | 1a414f670635 |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/examples/myfunc.c @@ -0,0 +1,12 @@ +#include "mex.h" + +void +mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) +{ + const char *nm; + nm = mexFunctionName (); + mexPrintf("You called function: %s\n", nm); + if (strcmp (nm, "myfunc") == 0) + mexPrintf("This is the principal function\n", nm); + return; +}