Skip to content

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.

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.

Dialog Box Parameters

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

Characteristics

Characteristic Description
Input Port Any data type supported by the blockset
Output Port A signed Fixed-Point Blockset data type
Direct Feedthrough Yes
Sample Time Inherited
Scalar Expansion N/A
States 0
Vectorized Yes