annotate examples/myfeval.c @ 17422:20d1b911b4e7 classdef

* libinterp/corefcn/load-path.cc (genpath): Ignore package dirs.
author Michael Goffioul <michael.goffioul@gmail.com>
date Thu, 12 Sep 2013 21:08:07 -0400
parents be41c30bcb44
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
1 #include "mex.h"
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
2
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
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
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
6 {
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
7 char *str;
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
8
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
9 mexPrintf ("Hello, World!\n");
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
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
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
12
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
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
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
15
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
16 str = mxArrayToString (prhs[0]);
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
17
7081
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
18 mexPrintf ("I'm going to call the function %s\n", str);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
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
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
21
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
22 mxFree (str);
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
23 }