view examples/celldemo.cc @ 18495:1ec884e5ff00 gui-release

waitbar.m: Force pixel units for waitbar figure (bug #41645). * waitbar.m: Use "pixel" units when creating waitbar figure so that the subsequent "position" property is always interpreted properly.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Thu, 20 Feb 2014 16:18:02 +0100
parents be41c30bcb44
children
line wrap: on
line source

#include <octave/oct.h>
#include <octave/Cell.h>

DEFUN_DLD (celldemo, args, , "Cell Demo")
{
  octave_value_list retval;
  int nargin = args.length ();

  if (nargin != 1)
    print_usage ();
  else
    {
      Cell c = args(0).cell_value ();
      if (! error_state)
        for (octave_idx_type i = 0; i < c.numel (); i++)
          {
            retval(i) = c(i);          // using operator syntax
            //retval(i) = c.elem (i);  // using method syntax
          }
    }

  return retval;
}