Main Content

Signal Sample and Hold

Discrete-time or Continuous-time sample and hold input signal

  • Signal Sample and Hold block

Libraries:
Simscape / Electrical / Control / General Control

Description

The Signal Sample and Hold block implements a signal sample and hold in either discrete or continuous time.

When input S is true, output y is equal to input u. When input S is false, the block holds the output until S becomes true again.

Ports

Input

expand all

Input signal.

Data Types: single | double

Sample pulse of 0 for false or 1 for true.

Data Types: Boolean

Output

expand all

Output signal.

Data Types: single | double

Parameters

expand all

Specify initial condition. The value must be a scalar or a vector of the same size as the input signal.

Time between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.

For inherited discrete-time operation, set this parameter to -1. For discrete-time operation, set this parameter to a positive integer. For continuous-time operation, set this parameter to 0.

If this block is in a masked subsystem or a variant subsystem that supports switching between continuous operation and discrete operation, promote this parameter to ensure correct switching between the continuous and discrete implementations of the block. For more information, see Promote Block Parameters on a Mask.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2018b