Can I use simulink.signal in variant Subsystem?

1 回表示 (過去 30 日間)
Daniel Pfuntz
Daniel Pfuntz 2015 年 10 月 23 日
回答済み: Dinesh 2024 年 7 月 3 日
I have an variant Subsystem. For the condition I would like to use and simulink.signal.
Variant1 = Simulink.Variant(' simulink.Signal==0');
Variant2 = Simulink.Variant(' simulink.Signal==1');
Is that possible?
Best regards
Jan

回答 (1 件)

Dinesh
Dinesh 2024 年 7 月 3 日
Hello,
Yes, you can use "simulink.signal" as a variant condition expression.
I see that you have defined objects of "Simulink.Variant". As of the latest release R2024a, you can make use of "Simulink.VariantExpression" objects instead. The structure remains the same as how you have declared the object.
In the block parameters dialog of variant blocks, you can just specify the object name directly in the "Variant condition expression" field. For example, "Variant1" for the first choice and "Variant2" for the second one. When you do that, it would fetch the condition specified from the object and populate the next column (read-only) with the condition expression.
Here's the documentation link for "Simulink.VariantExpression": https://www.mathworks.com/help/simulink/slref/simulink.variantexpression-class.html

カテゴリ

Help Center および File ExchangeComponent-Based Modeling についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by