Using Simulink | ![]() ![]() |
Continuous Versus Discrete Blocks
The standard Simulink block set includes continuous blocks and discrete blocks. Continuous blocks respond continuously to continuously changing input. Discrete blocks, by contrast, respond to changes in input only at integer multiples of a fixed interval called the block's sample time. Discrete blocks hold their output constant between successive sample time hits. Each discrete block includes a sample time parameter that allows you to specify its sample rate. Examples of continuous blocks include the Constant block and the blocks in the Continuous block library. Examples of discrete blocks include the Discrete Pulse Generator and the blocks in the Discrete block library.
Many Simulink blocks, for example, the Gain block, can be either continuous or discrete, depending on whether they are driven by continuous or discrete blocks. A block that can be either discrete or continuous is said to have an implicit sample rate. The implicit sample time is continuous if any of the block's inputs are continuous. The implicit sample time is equal to the shortest input sample time if all the input sample times are integer multiples of the shortest time. Otherwise, the input sample time is equal to the fundamental sample time of the inputs, where the fundamental sample time of a set of sample times is defined as the greatest integer divisor of the set of sample times.
Simulink can optionally color code a block diagram to indicate the sample times of the blocks it contains, e.g., black (continuous), magenta (constant), yellow (hybrid), red (fastest discrete), and so on. See Mixed Continuous and Discrete Systems for more information.
![]() | Block Parameters | Subsystems | ![]() |