Mercurial > hg > octave-nkf
annotate examples/mycell.c @ 9606:a04352386a6b
clear index cache on ++,-- operators
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 03 Sep 2009 06:59:53 +0200 |
parents | 4295d634797d |
children | 6cb30a539481 |
rev | line source |
---|---|
6593 | 1 #include "mex.h" |
2 | |
3 void | |
7081 | 4 mexFunction (int nlhs, mxArray* plhs[], int nrhs, |
5 const mxArray* prhs[]) | |
6593 | 6 { |
6686 | 7 mwSize n; |
8 mwIndex i; | |
6593 | 9 |
10 if (nrhs != 1 || ! mxIsCell (prhs[0])) | |
11 mexErrMsgTxt ("expects cell"); | |
12 | |
13 n = mxGetNumberOfElements (prhs[0]); | |
14 n = (n > nlhs ? nlhs : n); | |
15 | |
16 for (i = 0; i < n; i++) | |
17 plhs[i] = mxDuplicateArray (mxGetCell (prhs[0], i)); | |
18 } |