octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to return an array of struct?


From: shashank khare
Subject: how to return an array of struct?
Date: Mon, 8 Dec 2014 16:19:02 +0000

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?







reply via email to

[Prev in Thread] Current Thread [Next in Thread]