Output simulation time at specified sampling interval
The Digital Clock block outputs the simulation time only at the specified sampling interval. At other times, the block holds the output at the previous value. To control the precision of this block, set the Sample time parameter in the block dialog box.
Use this block rather than the Clock block (which outputs continuous time) when you need the current simulation time within a discrete system.
The Digital Clock block outputs a real signal of type double. For more information, see Data Types Supported by Simulink in the Simulink® documentation.
Specify the sampling interval. The default value is 1 second. For more information, see Specifying Sample Time in the Simulink documentation.
Do not specify a continuous sample time, either 0 or [0,0]. Also, avoid specifying -1 (inheriting the sample time) because this block is a source.
The Digital Clock block outputs the simulation time every 0.2 seconds. Otherwise, the block holds the output at the previous value.
Specified in the Sample time parameter