MATLAB: How to integrate MATLAB graphics into a C application

appenginefiguregraphimageimagesMATLAB

I want to integrate graphics from MATLAB into a C application. I would like to know if it is possible to instantiate MATLAB, evaluate commands in a MATLAB Engine session, and have the graphics display in my own application.

Best Answer

The ability to evaluate commands in a MATLAB Engine session and have the graphics directly displayed in your own application is not available in MATLAB.
However, you can save the image as pixels by using the following command:
mydata=frame2im(getframe())
Note: This command can be executed from within your C program with the use of
the ENGEVALSTRING command.
You can then send "mydata" to your engine application via the ENGGETVARIABLE function.
For more information on the FRAME2IM function, type the following at the MATLAB Command Prompt:
doc frame2im
For more information on ENGGETVARIABLE, type the following:
doc enggetvariable