how to count further?

1 回表示 (過去 30 日間)
Le Dyk Zuy
Le Dyk Zuy 2021 年 7 月 29 日
回答済み: Walter Roberson 2021 年 7 月 29 日
i did a counter that increments out1 by 1 on rising edge, but it only increments until 2, but i need it to increment further^ 2,3,4,5...etc. whats the issue?

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 7 月 29 日
Where do you transition from state2 to something else?
Are you trying to count all the rising edges, ignoring the falling edges?
Can there be a rising edge when you are already in a rising state? Like that second diagram where you have the stairs: is it possible to have input like that? If it is, then are you trying to keep a count of how many levels "up" you are right now, or should each rise be counted as one no matter whether you started from the base level or not?
In your first diagram, those pulses appear to have duration, so it seems plausible that stateflow is processing information in which the level continues to be high. If so you have a choice: transition back to base state as soon as you detect a rising edge -- or do not transition back to base state until you see the falling edge.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by