Can I use engGetVariable or mexGetVariable to retrieve objects in MATLAB 7.0 (R14)?

1 view (last 30 days)
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
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.

More Answers (0)

Products


Release

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!