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