How can I hold a true signal for a defined time after conditions are met in Simulink 8.3 (R2014a)?
82 views (last 30 days)
Show older comments
MathWorks Support Team
on 17 Jul 2014
Answered: MathWorks Support Team
on 13 Aug 2014
How can I hold a true signal for a defined time after conditions are met in Simulink 8.3 (R2014a)?
Accepted Answer
MathWorks Support Team
on 10 Sep 2018
Enabling a signal for a specified amount of time when triggered can be accomplished in several different ways in Simulink. The basic procedure to implement this type of logic is outlined, as follows:
1) Use a Simulink Clock block to get the current simulation time
2) Capture the current time when the enable/trigger event occurs
3) Disable the signal/enabled subsystem after the desired amount of time passes
See the attached example for an implementation with a MATLAB Function block using persistent variables.
More information on persistent variables in MATLAB Function blocks can be found, as follows:https://www.mathworks.com/help/matlab/ref/persistent.html
0 Comments
More Answers (0)
See Also
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!