Mercurial > hg > octave-lyh
annotate examples/myfeval.c @ 17389:06b46e67f868
build: Remove generated files so that 'make distcheck' passes.
* libgui/Makefile.am: Add default-qt-settings to DISTCLEANFILES.
* test/Makefile.am: Add .gdbinit to DISTCLEANFILES.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 05 Sep 2013 16:53:52 -0700 |
parents | be41c30bcb44 |
children |
rev | line source |
---|---|
5864 | 1 #include "mex.h" |
2 | |
3 void | |
16867
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
9932
diff
changeset
|
4 mexFunction (int nlhs, mxArray* plhs[], |
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
9932
diff
changeset
|
5 int nrhs, const mxArray* prhs[]) |
5864 | 6 { |
7 char *str; | |
8 | |
9 mexPrintf ("Hello, World!\n"); | |
10 | |
16867
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
9932
diff
changeset
|
11 mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs); |
5864 | 12 |
13 if (nrhs < 1 || ! mxIsString (prhs[0])) | |
16867
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
9932
diff
changeset
|
14 mexErrMsgTxt ("ARG1 must be a function name"); |
5864 | 15 |
16 str = mxArrayToString (prhs[0]); | |
17 | |
7081 | 18 mexPrintf ("I'm going to call the function %s\n", str); |
5864 | 19 |
16867
be41c30bcb44
Re-write documentation and all examples of dynamically linked functions.
Rik <rik@octave.org>
parents:
9932
diff
changeset
|
20 mexCallMATLAB (nlhs, plhs, nrhs-1, (mxArray*)prhs+1, str); |
5864 | 21 |
22 mxFree (str); | |
23 } |