Why does the output of an If Action Subsystem seem to hold the last computed value?
2 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2021 年 6 月 25 日
回答済み: MathWorks Support Team
2021 年 9 月 16 日
I am using a couple If Action Subsystems with an If block in Simulink. I have connected the outputs of the If Action Subsystems to a scope block, and the results I see are not what I was expecting.
The If Action Subsystems seem to hold the last-known value rather than resetting to zero. This means I can't add the outputs to achieve my desired output. How can I make these signals reset to zero when the subsystem isn't active?
採用された回答
MathWorks Support Team
2021 年 6 月 25 日
This behavior is by design. We recommend using a Merge block to consolidate the outputs from If Action Subsystems, as the Merge block will automatically select the most recently-computed input as its output.
For more information about the Merge block, please see the following documentation page: https://www.mathworks.com/help/simulink/slref/merge.html
The following documentation page provides usage examples for the If Action Subsystems, with the recommended workflow of using a Merge block to consolidate the signals:
There is a way to force the individual If Action Subsystem outputs to reset to 0 or another provided value when they are no longer active.
To define this reset behavior:
1. Double click on one of the If Action subsystems
2. Double click on the Out block inside the subsystem (Out1 by default)
3. Select "Output when disabled" to be "reset" instead of "held"
4. Define Initial Output as 0 or another desired value to reset to
5. Do the same workflow for the other If Action subsystems
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Subsystems についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!