annotate examples/myfeval.c @ 8710:739141cde75a ss-3-1-52

fix typo in Array-f.cc
author Jaroslav Hajek <highegg@gmail.com>
date Mon, 09 Feb 2009 21:51:31 +0100
parents 503001863427
children 4295d634797d
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: 5864
diff changeset
1 /*
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 5864
diff changeset
2
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 5864
diff changeset
3 Copyright (C) 2006, 2007 John W. Eaton
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 5864
diff changeset
4
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 5864
diff changeset
5 This file is part of Octave.
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 5864
diff changeset
6
7081
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
7 Octave is free software; you can redistribute it and/or
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
8 modify it under the terms of the GNU General Public License
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
9 as published by the Free Software Foundation; either
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
10 version 3 of the License, or (at your option) any later
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
11 version.
7019
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 5864
diff changeset
12
7081
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
13 Octave is distributed in the hope that it will be useful,
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
15 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
16 See the GNU General Public License for more details.
7019
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 5864
diff changeset
17
7081
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
18 You should have received a copy of the GNU General Public
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
19 License along with Octave; see the file COPYING. If not,
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
20 see <http://www.gnu.org/licenses/>.
7019
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 5864
diff changeset
21
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 5864
diff changeset
22 */
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 5864
diff changeset
23
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
24 #include "mex.h"
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
25
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
26 void
7081
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
27 mexFunction (int nlhs, mxArray* plhs[], int nrhs,
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
28 const mxArray* prhs[])
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
29 {
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
30 char *str;
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
31
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
32 mexPrintf ("Hello, World!\n");
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
33
7081
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
34 mexPrintf ("I have %d inputs and %d outputs\n", nrhs,
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
35 nlhs);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
36
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
37 if (nrhs < 1 || ! mxIsString (prhs[0]))
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
38 mexErrMsgTxt ("function name expected");
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
39
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
40 str = mxArrayToString (prhs[0]);
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
41
7081
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
42 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
43
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
44 mexCallMATLAB (nlhs, plhs, nrhs-1, prhs+1, str);
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
45
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
46 mxFree (str);
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
47 }