Simulink Problem

Hi. I am relatively new to Simulink. I have to check a value whether it is within a upper and lower limit and if comaprision is true, I have to increment a counter and keep it updating continuously and have to save that value in each iteration . How shall i do it in Simulink?

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 10 月 22 日

0 投票

Have the comparison block emit a 0 if the comparison is false, and a 1 if the comparison is true, and feed the output of that to an integrator block, perhaps?
In general, the operation of "totaling" in Simulink is often most easily expressed as an integrator block.

2 件のコメント

Ramakrishna
Ramakrishna 2011 年 10 月 22 日
Thanks for your reply. But i wanna know how i can increment a counter(when condition true, when false, I am terminating) and keep it updating for every iteration in Simulink?
Kaustubha Govind
Kaustubha Govind 2011 年 10 月 24 日
Have you implemented your own counter, or are you using something from the Simulink library? You could try using the Free-Running Counter block (http://www.mathworks.com/help/toolbox/simulink/slref/counterfreerunning.html) inside an Enabled Subsystem that has the output of your comparison as the enable (control) signal.

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

カテゴリ

ヘルプ センター および File ExchangeSchedule Model Components についてさらに検索

質問済み:

2011 年 10 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by