view examples/code/mycell.c @ 31195:776446acdc7b

pkg.m: Show URL of source tarball(s) in verbose mode. * scripts/pkg/pkg.m: If downloading source tarballs with the "-forge" option, show the URL where they are downloaded from if verbose mode is on.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 19 Aug 2022 08:54:05 +0200
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));
}