Can I use engGetVariable or mexGetVariable to retrieve objects in MATLAB 7.0 (R14)?
1 view (last 30 days)
Show older comments
I am using MATLAB's C interface and would like to retrieve a variable that is a MATLAB object. However, when I use engGetVariable or mexGetVariable to retrieve one, an application error is thrown with the dialog:
The instruction at "0x78806af2" referenced memory at "0x000000040". The memory could not be "read".
Accepted Answer
MathWorks Support Team
on 25 Feb 2013
The MATLAB C interface (MEX or MATLAB Engine) is unable to retrieve certain objects from the MATLAB workspace as we can't represent MATLAB objects outside the MATLAB process at this time. There is no way to get the object back into a C++ application outside of MATLAB.
As a workaround, you can call MATLAB code through Engine that queries property values on the object in MATLAB and returns strings or other primitive arrays back to the engine application.
0 Comments
More Answers (0)
See Also
Categories
Find more on Call MATLAB from C in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!