主要内容

Sample and Hold

(To be removed) Sample first input and hold its value based on value of second input

The Specialized Power Systems library will be removed in R2026a. Use the Simscape™ Electrical™ blocks and functions instead. For more information on updating your models, see Upgrade Specialized Power System Models to use Simscape Electrical Blocks.

Library

Simscape / Electrical / Specialized Power Systems / Control

  • Sample and Hold block

Description

The Sample and Hold block outputs the In input signal as long as S input signal is true. The block holds the output when the S input signal becomes false.

Parameters

Initial condition

Specify the initial value of the output. Default is 0.

Sample time

Specify the sample time of the block, in seconds. Set to 0 to implement a continuous block. Default is 0.

Inputs and Outputs

In

The signal.

S

The control signal, which must be a Boolean.

Out

The sampled signal.

Characteristics

Direct FeedthroughYes
Sample TimeSpecified in the Sample Time parameter
Scalar ExpansionYes
DimensionalizedYes
Zero-Crossing DetectionNo

Version History

Introduced in R2013a