MATLAB: Run simulink model from visual studio GUI

MATLABvisual studio

Create an exe by name Test.exe using VC++ Form Application
Place 3 buttons on it naming Start, Stop, Pause
The user should be able to Start,Stop,Pause simulation Time of a model(Ex:Display.mdl)using these buttons.
If needed, you can include the path of Display.mdl in Test.exe

Best Answer

You can start MATLAB as a COM server and execute the relevant MATLAB commands from your VC++ application:
set_param('Display', 'SimulationCommand', 'start')
set_param('Display', 'SimulationCommand', 'stop')
set_param('Display', 'SimulationCommand', 'pause')