From octave-maintainers-request at bevo dot che dot wisc dot edu Thu Mar 4 07:00:50 2004 Subject: Re: Nd cell array From: David Bateman To: "Philipp.Batchelor" Cc: octave-maintainers-list Date: Thu, 4 Mar 2004 13:58:56 +0100 What about something like #include #include DEFUN_DLD (myvol, args, , "-*- texinfo -*-\n\ at deftypefn {Loadable Function} {@var{v} =} myvol (@var{n})\n\ \n\ Create at var{n} by 1 cell array of matrices\n\ at end deftypefn\n") { octave_value retval; int n = args(0).nint_value (); Cell c (n,1); // Just fill with empty matrices for this test for (int i = 0; i (on 03/04/04): > Hi, > > sorry, trying to reformulate, I posted to help-octave, maybe it is more > for this list. > > I am trying to read 3d volume data using another c++ library (vtk), and > load it into Octave, I thought I would return a cell array, > i.e. in an *.m file, the syntax would correspond to > > for slice = 1:n > volume{slice} = ...% some 2d array, say a Matrix > ...etc > > but I can't work out what the syntax in C++ would be. > How would I create an array with say 128 elements which are each a 2D > Matrix, and assign to elements, (and return this cell array) in a > dynamically loadable C++ file? > > Ph. Batchelor -- David Bateman David dot Bateman at motorola dot com Motorola CRM +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax) 91193 Gif-Sur-Yvette FRANCE The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary