check if a condition is true for a certain time (Simulink)

32 ビュー (過去 30 日間)
Marco Bellusci
Marco Bellusci 2020 年 3 月 10 日
コメント済み: Alberto Boñal Bravo 2021 年 11 月 23 日
I have a simple problem but i can't find a solution.
I have the following model:
and I would like to get 1 as output of this model when the condition is respect for 0.8 consecutive seconds.
How can i do it?
  1 件のコメント
Alberto Boñal Bravo
Alberto Boñal Bravo 2021 年 11 月 23 日
Hi Marco, can you show how you solved your model?
Thank you!

サインインしてコメントする。

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2020 年 3 月 10 日
Connect this condition to an integrator. If the condition is true, the integration will increase. Compare it to 0.8, you will get the result. Specify the integrator to be reset by external source. Use the fall edge or low level of your condition to reset it.
  4 件のコメント
ibrahim alzoubi
ibrahim alzoubi 2020 年 12 月 9 日
Fengjun Jiang.. You are such a genius
Thank you 10 times per second for 50 years.
Fangjun Jiang
Fangjun Jiang 2020 年 12 月 9 日
:). Thank you!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by