MATLAB: How to choose a particular input source to be used in the Simulink model with multiple sources in Simulink 7.6 (R2010b)

simulink

I have a Simulink model in which I have multiple sources that feed an input signal to the forward path. I would like to choose a particular input signal based on a condition or a user defined method.

Best Answer

You can use the 'Multi-port Switch' block in Simulink to help choose a particular input signal to be connect to the forward path.
The attached 'example.mdl' demonstrates this use case. In this model, the user can choose the desired constant source block using the drop down box in the 'Selector_subsystem'. C1, C2 and C3 represent sources 1, 2 and 3 respectively.
To see the implementation of the 'Selector_subsystem', right click the block and select 'Edit Mask'.