Manual Switch
Switch between two inputs
Libraries:
Simulink /
Signal Routing
Description
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. You 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.
To programmatically toggle the switch, set the set_param
sw
property to '0'
or '1'
. For
example, to connect the second input to the output:
set_param(gcb,'sw','0')
To connect the first input to the output:
set_param(gcb,'sw','1')
Note
Double-clicking the Manual Switch block does not open the block dialog box. Instead, it toggles the input choice.
Examples
Ports
Input
Output
Parameters
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Extended Capabilities
Version History
Introduced before R2006a
See Also
Switch | Multiport Switch | Manual Variant Source | Manual Variant Sink