Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Manual Switch

Switch between two inputs

Library

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. 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.

Parameters and Dialog Box

Double-clicking the Manual Switch block toggles the input. To open the block dialog box, right-click the block and select Block Parameters.

Allow the two inputs to differ in size

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

Settings

Default: Off

On

Block allows input signals with different sizes, and propagates the input signal size to the output signal.

Off

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: string
Value: 'on' | 'off'
Default: 'off'

Sample time (-1 for inherited)

Enter the discrete interval between sample time hits or specify another appropriate sample time such as continuous or inherited.

Settings

Default: -1

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.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Examples

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

  • sldemo_auto_climatecontrol

  • sldemo_fuelsys

  • sldemo_doublebounce

Characteristics

Direct Feedthrough

Yes

Sample Time

Specified in the Sample time parameter

Scalar Expansion

Yes

Dimensionalized

Yes

Multidimensionalized

Yes

Zero-Crossing Detection

No

Was this topic helpful?