Mercurial > hg > octave-lyh
annotate examples/myset.c @ 15497:c49d891eb263 stable
Update broken or inconsistent project and wiki urls
* README, doc/interpreter/contrib.txi, etc/HACKING, etc/README.MacOS,
etc/README.MinGW, etc/README.devel: Update urls to use the octave.org domain.
* doc/faq/OctaveFAQ.texi, scripts/miscellaneous/info.m: Replace broken links
to the manual and help mailing list.
* doc/faq/OctaveFAQ.texi, etc/PROJECTS, etc/README.MacOS: Update wiki urls to
short naming scheme.
* doc/interpreter/contrib.txi, scripts/help/unimplemented.m: Make Octave-Forge
project urls consistent.
* src/version.h.in: Update url to contribution page.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Mon, 08 Oct 2012 08:01:07 -0400 |
parents | 4295d634797d |
children | be41c30bcb44 |
rev | line source |
---|---|
5864 | 1 #include "mex.h" |
2 | |
3 void | |
4 mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) | |
5 { | |
6 char *str; | |
7 mxArray *v; | |
8 | |
9 if (nrhs != 2 || ! mxIsString (prhs[0])) | |
10 mexErrMsgTxt ("expects symbol name and value"); | |
11 | |
12 str = mxArrayToString (prhs[0]); | |
13 | |
14 v = mexGetArray (str, "global"); | |
15 | |
16 if (v) | |
17 { | |
18 mexPrintf ("%s is a global variable with the following value:\n", str); | |
19 mexCallMATLAB (0, 0, 1, &v, "disp"); | |
20 } | |
21 | |
22 v = mexGetArray (str, "caller"); | |
23 | |
24 if (v) | |
25 { | |
26 mexPrintf ("%s is a caller variable with the following value:\n", str); | |
27 mexCallMATLAB (0, 0, 1, &v, "disp"); | |
28 } | |
29 | |
30 // WARNING!! Can't do this in MATLAB! Must copy variable first. | |
31 mxSetName (prhs[1], str); | |
32 mexPutArray (prhs[1], "caller"); | |
33 } |