Running a Simulink Model and Generated Executable in Soft Real-Time
First, run the model ScheduleSimulinkExample. The simulation will run in Soft Real-Time and as a result, so will the print statements.
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.
Running the model directly in simulation mode and running the executable version of it both results in Soft Real-Time execution.