Signal Sample and Hold

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

  • Library:
  • 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? (Simulink) and Specify Sample Time (Simulink).

For inherited discrete-time operation, specify -1. For discrete-time operation, specify a positive integer. For continuous-time operation, specify 0.

If this block is in a masked subsystem, or other variant subsystem that allows you to switch between continuous operation and discrete operation, promote the sample time parameter. Promoting the sample time parameter ensures correct switching between the continuous and discrete implementations of the block. For more information, see Promote Parameter to Mask (Simulink).

Extended Capabilities

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

Introduced in R2018b