Skip to content

FixPt Constant

Generate a constant value.

Description

The FixPt Constant block is a masked S-function that generates a constant value. You specify constants with the Constant value parameter. A constant can be a scalar or a vector.

You specify the output scaling with the Output scaling parameter. Note that there are two dialog box parameters that control the output scaling: one associated with an edit field, and one associated with a parameter list. If Output data type is a generalized fixed-point number such as sfix(16), the Output scaling parameter list provides you with these scaling modes:

  • Use Specified Scaling - This mode uses the slope/bias or radix point-only scaling specified for the editable Output scaling parameter (for example, \(2^{-10}\)).
  • Best Precision: Vector-wise - This mode produces a common radix point for each element of the Constant value vector based on the best precision for the largest value of the vector.

Dialog Box Parameters

  • Constant value - Constant value output by the block. It can be a scalar or vector. All members of the output vector must be the same data type. The parameter value is converted from a double to the specified output data type offline using round-to-nearest and saturation
  • Output data type and scaling - Specify the output data type and scaling via the dialog box, or inherit the data type and scaling via back propagation.
  • Output data type - Any data type supported by the Fixed-Point Blockset.
  • Output scaling - Radix point-only or slope/bias scaling. Additionally, if Constant value is specified as a vector, it can be scaled using the constant vector scaling modes for maximizing precision. These scaling modes are available only for generalized fixed-point data types.
  • Override data type(s) with doubles - If checked, the output data type is overridden with doubles.

Characteristics

Characteristic Description
Output Port Any data type supported by the blockset
Direct Feedthrough No
Sample Time Inherited
Scalar Expansion No - the output is always the same size as Constant value
States 0
Vectorized Yes