| DSP Blockset | ![]() |
Sample and hold an input signal
Library
Description
The Sample and Hold block acquires the input at the signal port whenever it receives a trigger event at the trigger port (marked by
). The block then holds the output at the acquired input value until the next triggering event occurs. If the acquired input is frame based, the output is frame based; otherwise, the output is sample based.
The trigger input must be a sample-based scalar with sample rate equal to the input frame rate at the signal port. The trigger event is specified by the Trigger type pop-up menu, and can be one of the following:
Rising edge triggers the block to acquire the signal input when the trigger input rises from a negative value or zero to a positive value.
Falling edge triggers the block to acquire the signal input when the trigger input falls from a positive value or zero to a negative value.
Either edge triggers the block to acquire the signal input when the trigger input either rises from a negative value or zero to a positive value or falls from a positive value or zero to a negative value.
The block's output prior to the first trigger event is specified by the Initial condition parameter. If the acquired input is an M-by-N matrix, the Initial condition can be an M-by-N matrix, or a scalar to be repeated across all elements of the matrix. If the input is a length-M 1-D vector, the Initial condition can be a length-M row or column vector, or a scalar to be repeated across all elements of the vector.
Dialog Box
Supported Data Types
To learn how to convert your data types to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.
See Also
| Downsample |
DSP Blockset |
| N-Sample Switch |
DSP Blockset |
| RMS | Scalar Quantizer | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |