[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to return an array of struct?
From: |
Philip Nienhuis |
Subject: |
Re: how to return an array of struct? |
Date: |
Tue, 9 Dec 2014 09:24:41 -0800 (PST) |
shash wrote
> I am trying to put in support for shape and geotiff and I am facing a
> problem with returning structure array to mcode from oct file.
> Documentation available says use octave_map for array of struct and
> octave_scalar_map for a struct. Do I create an array of struct like this:
>
>
> dim_vector a(2);
> a(0) = 2;
> a(1)= 1;
>
>
> octave_map ret_array(a);
> octave_scalar_map b;
> b.assign(string("field1"), octave_value(string("test"));
>
>
> ret_array(0) = b;
> ....
>
>
> The problem with this that I am unable to access struct b from m file
> though octave tells me that 'a' is a struct array. Where am i going
> wrong?
Try downloading the OF struct package from octave.sf.net.
In the src/ subdir in the archive there are some functions that may have
some clues.
Philip
--
View this message in context:
http://octave.1599824.n4.nabble.com/how-to-return-an-array-of-struct-tp4667722p4667732.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.