From help-request at octave dot org Tue Apr 11 04:27:51 2006 Subject: Re: Vectors of Structures in C++ From: Bill Denney To: "John W. Eaton" cc: help at octave dot org Date: Tue, 11 Apr 2006 05:26:15 -0400 (EDT) That worked just like I wanted, thanks. Bill On Mon, 10 Apr 2006, John W. Eaton wrote: > Try this: > > #include > #include > #include > > octave_value > GetSubstruct (void) > { > Octave_map m; > > Cell tmp (dim_vector (10, 1)); > > for (int i = 0; i < 10; i++) > tmp(i) = i+1; > > m.assign ("d", tmp); > > return m; > } > > DEFUN_DLD (TranslateSBML, , , > "TranslateSBML") > { > Octave_map m; > > m.assign ("b", "B"); > m.assign ("c", GetSubstruct ()); > > return octave_value (m); > } > > jwe > -- "Don't ever take a city for granted. "After all, it is bigger than you are; it is older; and it has learned how to wait..." -- Neil Gaiman ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------