How to create an empty Variant Subsystem without getting an error message?

What would be the recommended way to handle an intentionally empty model within a 'Subsystem Variant' block? For example, I have a model with a "Variant Subsystem" block with two subsystems. Variant A has logging and Variant B should have no logging. Variant B consists of an “Inport” and a “Terminator” block. However, my model outputs this error message:

Error:Block diagram 'TranslationVelLimitsDeratingLogging' contains no blocks or all blocks are virtual
How do I make Variant B do nothing without throwing an error message? 

 采纳的回答

In order to have a Variant Subsystem, there must be a nonvirtual block within the subsystem.
Since the “Inport” and “Terminator” blocks are both virtual blocks, they lead to the mentioned error. To create an empty Variant Subsystem, we can add a nonvirtual block such as a "gain" block between the “Inport” and “Terminator” blocks. This will remove the error, but you may still experience a warning message stating that there is nothing to simulate while this variant is active. 

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Component-Based Modeling 的更多信息

产品

版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by