Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Pass arbitrary pointer type between mex functions
Replies: 6   Last Post: Dec 4, 2012 6:24 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bruno Luong

Posts: 8,565
Registered: 7/26/08
Re: Pass arbitrary pointer type between mex functions
Posted: May 24, 2012 2:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Cody" wrote in message <jpk840$ko1$1@newscl01ah.mathworks.com>...

> Thanks for the response James. Since there's not an elegant solution to pass this pointer back to the Matlab workspace,

Why not cast the pointer to uint64, or double, or 1x8 uint8 array (whatever that has the same size as a ppointer) and return it to MATLAB as mxArray?

>do you know if there is a way I can store the user defined pointer in a memory location so that different mex functions, called separately from the Matlab command line can access this memory location and therefore the pointer?

Just pass the pointers in mxArray as I explain above.

Brunp



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.