annotate examples/firstmexdemo.c @ 7021:0b91144f9533 ss-2-9-15

[project @ 2007-10-13 14:34:06 by jwe]
author jwe
date Sat, 13 Oct 2007 14:34:07 +0000
parents 4270ded9ddc6
children 503001863427
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7019
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
1 /*
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
2
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
3 Copyright (C) 2007 John W. Eaton
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
4
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
5 This file is part of Octave.
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
6
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
8 under the terms of the GNU General Public License as published by the
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
10 option) any later version.
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
11
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
15 for more details.
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
16
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
17 You should have received a copy of the GNU General Public License
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
18 along with Octave; see the file COPYING. If not, see
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
19 <http://www.gnu.org/licenses/>.
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
20
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
21 */
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 6577
diff changeset
22
6577
f72d6d4b735a [project @ 2007-04-25 15:54:59 by jwe]
jwe
parents:
diff changeset
23 #include "mex.h"
f72d6d4b735a [project @ 2007-04-25 15:54:59 by jwe]
jwe
parents:
diff changeset
24
f72d6d4b735a [project @ 2007-04-25 15:54:59 by jwe]
jwe
parents:
diff changeset
25 void
f72d6d4b735a [project @ 2007-04-25 15:54:59 by jwe]
jwe
parents:
diff changeset
26 mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
f72d6d4b735a [project @ 2007-04-25 15:54:59 by jwe]
jwe
parents:
diff changeset
27 {
f72d6d4b735a [project @ 2007-04-25 15:54:59 by jwe]
jwe
parents:
diff changeset
28 mxArray *v = mxCreateDoubleMatrix (1, 1, mxREAL);
f72d6d4b735a [project @ 2007-04-25 15:54:59 by jwe]
jwe
parents:
diff changeset
29 double *data = mxGetPr (v);
f72d6d4b735a [project @ 2007-04-25 15:54:59 by jwe]
jwe
parents:
diff changeset
30 *data = 1.23456789;
f72d6d4b735a [project @ 2007-04-25 15:54:59 by jwe]
jwe
parents:
diff changeset
31 plhs[0] = v;
f72d6d4b735a [project @ 2007-04-25 15:54:59 by jwe]
jwe
parents:
diff changeset
32 }