Sample and Hold
Sample first input and hold its value based on value of second input
Library
Simscape / Electrical / Specialized Power Systems / Control
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 is0
.
Inputs and Outputs
In
The signal.
S
The control signal, which must be a Boolean.
Out
The sampled signal.
Characteristics
Direct Feedthrough | Yes |
Sample Time | Specified in the Sample Time parameter |
Scalar Expansion | Yes |
Dimensionalized | Yes |
Zero-Crossing Detection | No |
Examples
The power_SampleAndHold
example shows the operation of the Sample and Hold
block.
The model sample time is parameterized with the variable Ts (default value Ts = 50e-6). To simulate a continuous Bistable block, specify Ts = 0 in the MATLAB® Command Window.
Version History
Introduced in R2013a