Hold True Value for finite length of time
古いコメントを表示
I am fairly new to matlab and have been getting to grips with it over the past month so excuse me if I missed something very obvious.
I am using a relational operator that will output a true value (1) when the input single goes beyond a certain range. What I require is that when the input single goes beyond this certain range and the output single becomes true, to hold this true value (e.g. the constant one) for a period of time e.g. 10 seconds.
I have been trying to use enabled subsystems, switches and zero hold blocks but with little success.
Any help would be much appreciated.
Modeling using Simulink
1 件のコメント
Kaustubha Govind
2011 年 7 月 11 日
You may want to specify that you are modeling in Simulink. :)
採用された回答
その他の回答 (3 件)
Kaustubha Govind
2011 年 7 月 11 日
0 投票
An important thing to keep in mind when modeling in Simulink is that blocks run according to their sample time (see this blog post for information how you can look at your block's sample time). So if you are using a zero-order hold block, it will only hold the input for one sample period - you need to sample the sample time of the zero-order hold block to 10 seconds to achieve what you need.
3 件のコメント
Owen
2011 年 7 月 11 日
Kaustubha Govind
2011 年 7 月 11 日
Owen: It's not clear if you're saying whether this answer resolves your question or not. If it does, please accept it. If not, please elaborate on how it is not sufficient.
Owen
2011 年 7 月 11 日
Jie
2017 年 1 月 18 日
0 投票
Hi, I think I solved the problem in simulink. Please see the picture below. The 'Discrete-Time Integrator' Gain value should set to 1.

1 件のコメント
Vijay
2018 年 8 月 1 日
I want to hold the newest peak (the last peak – input changing from 0 to 1) for an hour. I used the zero order hold Block for that purpose (sample time 3600s). But the problem with zero order hold block is, it sometimes omits the peak and I am not getting why it does that.
As you see in the attached picture, the blue line is the held curve and the red one is the input. One can see that, in the places where I marked wrong, the peak is not held as wanted it to.
Anybody has experience with this matter?
カテゴリ
ヘルプ センター および File Exchange で General Applications についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



