/usr/share/doc/octave3.2-headers/examples/mycell.c is in octave3.2-headers 3.2.4-12.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include "mex.h"
void
mexFunction (int nlhs, mxArray* plhs[], int nrhs,
const mxArray* prhs[])
{
mwSize n;
mwIndex i;
if (nrhs != 1 || ! mxIsCell (prhs[0]))
mexErrMsgTxt ("expects cell");
n = mxGetNumberOfElements (prhs[0]);
n = (n > nlhs ? nlhs : n);
for (i = 0; i < n; i++)
plhs[i] = mxDuplicateArray (mxGetCell (prhs[0], i));
}
|