![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1155573/image.png)
Hold a value indefinitely once a condition becomes true
36 views (last 30 days)
Show older comments
Fawad Farooq Ashraf
on 13 Oct 2022
Commented: Fawad Farooq Ashraf
on 13 Oct 2022
I have a simulink block diagram which gives true or false based on a condition (relational operator). My problem is that once I get true for the first time, I want to stop checking the condition and just output true for the rest of simulation time. How can I do that in SIMULINK?
0 Comments
Accepted Answer
More Answers (1)
Les Beckham
on 13 Oct 2022
One way would be to route the output of the relational operator to two places: (1) a summing junction or an OR block, and (2) a memory block or unit delay block if your signals are discrete time. Then connect the output of the memory block to the other input of the OR block. I don't have Simulink right now or I'd create an example.
See Also
Categories
Find more on Simulink Functions 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!