How to Use Switch Simulink : MATLAB

Switch

Switch between two inputs.

Library

Nonlinear

Description


The Switch block propagates one of two inputs to its output depending on the value of a third input, called the control input. If the signal on the control (second) input is greater than or equal to the Threshold parameter, the block propagates the first input; otherwise, it propagates the third input. This figure shows the use of the block ports.

To drive the switch with a logic input (i.e., 0 or 1), set the threshold to 0.5.

Data Type Support

A Switch block accepts real- or complex-valued signals of any data type as switched inputs (inputs 1 and 3). Both switched inputs must be of the same type. The block output signal has the data type of the selected input. The data type of the threshold input must be boolean or double.

Parameters and Dialog Box

Threshold
The value of the control (the second input) at which the switch flips to its other state. You can specify this parameter as either a scalar or a vector equal in width to the input vectors.

Characteristics


Direct Feedthrough
Yes
Sample Time
Inherited from driving block
Scalar Expansion
Yes
Dimensionalized
Yes
Zero Crossing
Yes, to detect when the switch condition occurs

Contact

Talk to us

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores iusto fugit esse soluta quae debitis quibusdam harum voluptatem, maxime, aliquam sequi. Tempora ipsum magni unde velit corporis fuga, necessitatibus blanditiis.

Address:

9983 City name, Street name, 232 Apartment C

Work Time:

Monday - Friday from 9am to 5pm

Phone:

595 12 34 567