S function execution based on Simulation and RTW build

6 views (last 30 days)
I have a requirement to execute portion of S function based on if S function is invoked by Simulation or by RTW build.
I tried to use flags like MATLAB_MEX_FILE and MDL_RTW. But I couldn't make it working.
Any pointers how to differentiate these two situations?
Thanks.

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 12 Jun 2013
Typically this is achieved by creating a TLC file for the S-function (see Inlining S-functions). The TLC implementation is used for code-generation, and the code in the MEX-file is used for simulation.

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!