Question

I use Simulink Coder for C/C++ code generation from Simulink models, but when I connect a signal to a Scope block and build it for code generation scope doesn't open automatically. Is there a way to integrate Scope block in code generation so that it opens automatically running .exe file? Thanks in advance.

Was it helpful?

Solution

This cannot be done. Scopes are MATLAB figure windows, use MATLAB code in the background, and hence do not support code generation.

Assuming you are only interested in desktop simulation (i.e. not real-time code generation) then what you can do is write a MATLAB GUI that calls a Simulink Coder (RSIM target) generated exe (to run a simulation and store the results in .mat file), then deploy the MATLAB GUI using the MATLAB Compiler. It's far from ideal, but can be made to work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top