Mercurial > octave
view examples/code/mycell.c @ 31158:8f3885b4d7ae stable
test: Set random state and increase tolerance for interpn.m test (bug #62817)
author | Arun Giridhar <arungiridhar@gmail.com> |
---|---|
date | Thu, 28 Jul 2022 19:22:56 -0400 |
parents | c763214a8260 |
children |
line wrap: on
line source
#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 ("ARG1 must be a cell"); n = mxGetNumberOfElements (prhs[0]); n = (n > nlhs ? nlhs : n); for (i = 0; i < n; i++) plhs[i] = mxDuplicateArray (mxGetCell (prhs[0], i)); }