FixPt Switch

Switch output between the first input and the third input based on the value of the second input.

Description

The FixPt Switch block is a masked S-function that passes through the first (top) input or the third (bottom) input based on the value of the second (middle) input. The second input is called the control input.

The first input is passed through when the second input is greater than or equal to the value of the Threshold parameter. Otherwise, it passes the third input through. The threshold value is converted to the second input's data type.

For a detailed description of all other block parameters, refer to Block Parameters.

The output data type is determined by the input with the largest positive range. If the first input has a larger positive range than the third input, then it specifies the output data type. Otherwise, the third input specifies the output data type.

Parameters and Dialog Box

  • Threshold - Switch threshold that determines which input is passed to the output.

  • Output data type and scaling - Inherit the output data type and scaling from the driving block or by back propagation.

  • Round toward - Rounding mode for the fixed-point output.

  • Saturate to max or min when overflows occur - If checked, fixed-point overflows saturate. Otherwise, they wrap.

  • Log minimums and maximums - If checked, minimum and maximum simulation values are logged to the workspace.

Conversions

The Threshold parameter is converted offline to the second input's data type using round-to-nearest and saturation. Refer to Parameter Conversions for more information about parameter conversions.

Characteristics

Input Ports

Any data type supported by the blockset

Output Port 

Same as input port one

Direct Feedthrough

Yes

Sample Time

Inherited

Scalar Expansion

Yes

States

0

Vectorized

Yes