Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Ajay
Posts:
8
Registered:
3/21/08


Re: Making C++ objects persistent between mex calls, and robust.
Posted:
May 24, 2012 11:33 PM


Hello,
I am running in to the same problem and I have a confusion. How did you manage not to go through the Integer>Double>Integer conversions. If I want to return data from mex file back to Matlab i would need to get the pointer to the lhs which is a double pointer. And the same when I pass data from Matlab to mex file. If you could give me some pointers on this it would be very helpful
Thanks, Ajay
"newuser asdf" wrote in message <ihgtig$df3$1@fred.mathworks.com>... > "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <ihgosg$914$1@fred.mathworks.com>... > > Rune Allnor <allnor@tele.ntnu.no> wrote in message <b3aa9d922fe94788a3c046ff3e6d6bca@k42g2000yqa.googlegroups.com>... > > > > > > > > When you return back to matlab, you enter a world where > > > Java is a dominant player. As I understand it, the > > > matlab user interface (where you access the workspaces etc) > > > are programmed in Java, in which case the Java interpterer > > > starts messing things up. And the Java interpterer, too, > > > interacts with the OS. Not necessarily in exactly the same > > > way that the C++ compiler does, though. > > > > NO, Matlab uses Java engine for graphical purpose only, it does not interact with data, code, internal storing, ... so it does not mess in anyway user data as you assume. Transfer pointers and persistent variable work just fine. > > > > Bruno > > Thanks for your help  it works now (without Integer>Double>Integer conversions). > I know that the way I do all this (creating C++ memory leaks, that have to be cleaned up using Matlab...) is not very "clean" programming. But at least it works... > > sabine



