How to stop if else condition after it executes only once.
2 次查看(过去 30 天)
显示 更早的评论
I have created a simulink block to execute if else condition. But, I need to stop this condition after it exucute once. How to do it?
3 个评论
Soniya Jain
2021-6-27
I am not sure but you can try to use "persistent" variable in your code, persistent means that the variable will still remember its value the next time the function is called. Refer a MATLAB Answer https://www.mathworks.com/matlabcentral/answers/113017-only-check-if-statement-once-or-disable-code-block-after-1-check
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!