view examples/mycell.c @ 14163:55d41048ea68 stable

update FCN_FILES list in test/Makefile.am * test/Makefile.am (FCN_FILES): Rename test_contin.m to test_line_contine.m in the list. Include test_index.m and test_logical_index.m in the list. Remove test_index-wfi-f.m, test_index-wfi-t.m, test_logical-wfi-f.m, test_logical-wfi-t.m from the list.
author John W. Eaton <jwe@octave.org>
date Fri, 06 Jan 2012 13:46:56 -0500
parents 6cb30a539481
children be41c30bcb44
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 ("expects cell");

  n = mxGetNumberOfElements (prhs[0]);
  n = (n > nlhs ? nlhs : n);
  
  for (i = 0; i < n; i++)
    plhs[i] = mxDuplicateArray (mxGetCell (prhs[0], i));
}