Scheduling with an Executable

These demos show how to use schedule tasks when generating an executable.

To perform scheduling in MATLAB, normally a timer or tic/toc can be used. However, these functions are not unsupported for code generation.

As a result, we will use the etic and etoc functions in MATLAB to keep track of time.

In Simulink, we can use the Soft Real-Time block for both simulation and executable deployment.

MATLAB Scheduling

To schedule MATLAB code that will be converted into an executable, use the etic and etoc functions.

Open Example

Simulink Scheduling

To schedule Simulink code use the Soft Real-Time block.

Open Example

Note: If you wanted to implement your own real-time scheduling system, you can do so using the coder.ceval method in MATLAB and the MATLAB System Object in Simulink. Contact auvsifdn@mathworks.com for more information on this topic.