Zero Order Hold with variable time step
This submission demonstrates how to write a level-2 M-file S-function with a variable sample time.
The block samples and holds an input signal were the inter-sample period is specified by another input signal (and may vary from time period to time period).
Each step size must be positive or an error is thrown.
Cite As
Phil Goddard (2023). Zero Order Hold with variable time step (https://www.mathworks.com/matlabcentral/fileexchange/31711-zero-order-hold-with-variable-time-step), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Simulink > Block Authoring and Simulation Integration > Extend Modeling Functionality with Custom Blocks > Implement Algorithms Using MATLAB > Create and Configure MATLAB S-Functions > Create MATLAB S-Functions >
Tags
Acknowledgements
Inspired by: Pulse with jitter
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |