Switch between two inputs
The Manual Switch block is a toggle switch that selects one of its two inputs to pass through to the output. To toggle between inputs, double-click the block. The block propagates the selected input to the output, while the block discards the unselected input. You can interactively control the signal flow by setting the switch before you start the simulation or by changing the switch while the simulation is executing. The Manual Switch block retains its current state when you save the model.
The Manual Switch block accepts real or complex signals of any data type that Simulink® supports, including fixed-point and enumerated data types. For more information, see Data Types Supported by Simulink in the Simulink documentation.
Double-clicking the Manual Switch block toggles the input. To open the block dialog box, right-click the block and select Block Parameters.
Select this check box to allow input signals with different sizes.
Block allows input signals with different sizes, and propagates the input signal size to the output signal.
Block expands scalar inputs to have the same dimensions as nonscalar inputs. For more information, see Scalar Expansion of Inputs and Parameters.
|Value: 'on' | 'off'|
Enter the discrete interval between sample time hits or specify another appropriate sample time such as continuous or inherited.
By default, the block inherits its sample time based upon the context of the block within the model. To set a different sample time, enter a valid sample time based upon the table in Types of Sample Time.
See also Specify Sample Time in the online documentation for more information.
See Block-Specific Parameters for the command-line information.
The following models show how to use the Manual Switch block: