MATLAB Examples

Adaptive Interface for Variant Subsystems

When you select the Propagate conditions outside of variant subsystem check box in the Block Parameters dialog box, the Variant Subsystem adapts its interface to the connected blocks. Consider this model.

The Controller block is a Variant Subsystem that provides a Linear and a Nonlinear choice. The Linear choice is active when V = 1, and the Nonlinear choice is active when V = 2. Here, V is a variant control variable of the Simulink.Parameter type. Select the Controller block and, in Simulink click Diagram > Block Parameters (Subsystem). Verify that the Propagate condition outside of variant subsystem check box is selected.

To change the value of the variant control variable, in the MATLAB command window, type V.Value = 1 or V.Value = 2.

Double-click the Controller block to view its contents. The Linear choice is using sensor1 and sensor3 inputs of the Controller (Variant Subsystem block). It is not using sensor2 and, therefore, does not produce a saturate output.

When you simulate this model, the Variant Subsystem block adapts its interface such that the condition V = 2 (v:1 V=2) propagates the In2, the filter, and the saturation logger blocks.