Use fixed-step or variable-step solvers for models that run at one or more sample rates. Single-tasking and multitasking execution modes are available only for fixed-step solvers. A real-time program executes model code synchronously with real time.
To generate code that executes in real time, identify and handle sample rate transitions within the model.
- Time-Based Scheduling and Code Generation
Generate code that meets real-time execution requirements after reviewing sample time and tasking mode considerations.
- Configure Generated C Function Interface for Model Entry-Point Functions
Learn about generated C entry-point functions, configuration options, and how to interface with them.
- Execution of Code Generated from a Model
Execute code generated from single-tasking and multitasking models for rapid-prototyping and embedded system run-time environments.
- Modeling for Single-Tasking Execution
Use the base sample rate of a model to define the time interval during which blocks in the model execute.
- Modeling for Multitasking Execution
Include blocks that use different sample rates, or use different sample rates for continuous and discrete parts of a model.
- Handle Rate Transitions
Handle transitions between blocks with different periodic sample rates.
- Configure Time-Based Scheduling
Configure model configuration parameters that are relevant to time-based scheduling of generated code.
- S-Functions for Multirate Multitasking Environments
Explains how to handle rate-grouped tasks in multirate, port-based sample time S-functions.
- Time-Based Scheduling Example Models
Models that show time-based scheduling scenarios.