This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Manual Switch

Switch between two inputs


Signal Routing


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.

Data Type Support

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.


Allow the two inputs to differ in size

Select this check box to allow input signals with different sizes.


Default: Off


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.

Command-Line Information

Parameter: varsize
Type: character vector
Value: 'on' | 'off'
Default: 'off'

Sample time


The following models show how to use the Manual Switch block:

  • sldemo_auto_climatecontrol

  • sldemo_fuelsys

  • sldemo_doublebounce


Data Types

Double | Single | Boolean | Base Integer | Fixed-Point | Enumerated | Bus

Sample Time

Inherited from driving block

Direct Feedthrough


Multidimensional Signals


Variable-Size Signals


Zero-Crossing Detection


Code Generation


Introduced before R2006a

Was this topic helpful?