| Contents | Index |
Sources
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.
In the following model, the Scope block shows the output of a Digital Clock block with a Sample time of 0.2.

The Digital Clock block outputs the simulation time every 0.2 seconds. Otherwise, the block holds the output at the previous value.

Sample Time | Specified in the Sample time parameter |
Scalar Expansion | No |
Dimensionalized | No |
Multidimensionalized | No |
Zero-Crossing Detection | No |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |