help-octave
[Top][All Lists]
Advanced

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

Re: passing and modifying structures in mex octave functions


From: hafedh trigui
Subject: Re: passing and modifying structures in mex octave functions
Date: Sat, 26 Nov 2011 07:59:19 -0800 (PST)

Thank you very much Ben. I have indeed looked at this example as well as the matlab example phonebook.c where it is possible to read a structure and re-write it in another form or change its type to cell...
In my example, I'd like to pass a structure array to other C++ function and my problem is that other than mexFunction, the other functions do not recognize the same variable as a Structure array.
I'll greatly appreciate your help or Arnaud help or anyone else from Octave communauty.
Thanks again
Hafedh

From: Ben Abbott <address@hidden>
To: hafedh trigui <address@hidden>
Cc: "address@hidden" <address@hidden>; "address@hidden" <address@hidden>
Sent: Friday, November 25, 2011 6:23:18 PM
Subject: Re: passing and modifying structures in mex octave functions

On Nov 25, 2011, at 2:58 PM, hafedh trigui wrote:

> Hi Ben,

> I wanted to pass a structure into a mex file and modify its fields as required by the algorithm.
> In my full code, the same structure will be passed to many C++ functions and modified as required. I only attached a snapshot of the code (Visual Studio C++ 2005) highlighting the problem.
> The test.m function (in debug directory) specifies the structure to be passed to the mex function.

> I'll greatly appreciate your help.

> Thank you in advance,
> Hafedh

I'm not familiar with this subject, but I noticed there is a section in the manual on this subject. An example is included.

    http://www.gnu.org/software/octave/doc/interpreter/Structures-with-Mex_002dFiles.html

My c/c++ experience is very limited (close to nil). I expect you'll be able to solve your problem faster than I can, but if the link above doesn't help, I can give it a try.

Ben




reply via email to

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