Running a Simulink Model and Generated Executable in Soft Real-Time

Contents

Running the model directly in simulation mode

First, run the model ScheduleSimulinkExample. The simulation will run in Soft Real-Time and as a result, so will the print statements.

Generate an Executable (.exe) from Simulink and run

Then, run the script buildSimulinkSoftRealTimeExample which generates an executable from the previously run model, ScheduleSimulinkExample.

It then runs the executable using the system command. This executable could also be run in a terminal outside of MATLAB.

Summary

Running the model directly in simulation mode and running the executable version of it both results in Soft Real-Time execution.