Main Content

Create Rate-Based Model

A rate-based model is a model with explicitly scheduled rates. You can schedule the execution rate of blocks that have a Sample time parameter, such as Inport, Subsystem, and Delay blocks.

For a subsystem in a rate-based model, you can schedule the execution rate with the Sample time parameter of any of these blocks.

  • An Inport block connected to the Subsystem block. A subsystem has multiple rates when Inport blocks provide different sample times to the subsystem.

  • The Subsystem block. When a Subsystem block specifies a sample time, the blocks it contains must use the same sample time or a constant sample time.

  • A block within the Subsystem block where sample time can be specified. A subsystem has multiple rates when the blocks it contains specify different sample times.

Subsystems with periodic sample times do not support continuous-time blocks, such as Integrator blocks. Instead, use equivalent discrete-time blocks, such as Discrete-Time Integrator blocks.

Rate-Based Model with Scheduled Subsystem Blocks

The completed rate-based model ex_rate_based_model has two scheduled atomic Subsystem blocks. The Subsystem blocks are scheduled by setting their Sample time parameters to a non-zero positive number.

Open the Property Inspector and check the sample time of each Subsystem block.

  • Click the Subsystem block named Subsystem1. The Sample time parameter is set to 0.2.

  • Click the Subsystem block named Subsystem2. The Sample time parameter is set to 0.4.

Examine the contents of each subsystem.

The block named Subsystem1 multiplies its input by 2.

The block named Subsystem2 multiplies its input by 4.

See Also

|

Related Topics