Skip to content

FixPt Look-Up Table

Approximate a one-dimensional function using a selected look-up method.

Description

The FixPt Look-Up Table block is a masked S-function that computes an approximation to some function y = f(x) given x, y data vectors. The look-up method can use interpolation, extrapolation, or the original values of the input.

The length of the x and y data vectors provided to this block must match. Also, the x data vector must be strictly monotonically increasing after conversion to the input's fixed-point data type. Note that due to quantization, the x data vector may be strictly monotonic in doubles format, but not so after conversion to a fixed-point data type. To map two inputs to an output, use the FixPt Look-Up Table (2D) block.

Note

To avoid parameter saturation errors, the automatic scaling script autofixexp employs a special rule that modifies the scaling by using the output look-up values in addition to the logged minimum and maximum simulation values. This prevents the data from being saturated to different values. The look-up values are given by the output vector (the YDataPoints variable).

Dialog Box Parameters

  • Vector of input values - A 1-by-n vector of input values, which must be the same size as the output vector and strictly monotonically increasing.
  • Vector of output values - A 1-by-n vector of output values, which must be the same size as the input vector.
  • Look-up method - Output generation method. See the section below for details.
  • Output data type and scaling - Specify the output data type and scaling via the dialog box, or inherit the data type and scaling by back propagation.
  • Output data type - Any data type supported by the Fixed-Point Blockset.
  • Output scaling - Radix point-only or slope/bias scaling. These scaling modes are available only for generalized fixed-point data types.
  • Lock output scaling so autoscaling tool can't change it - If checked, the output scaling is locked. This feature is available only for generalized fixed-point output.
  • 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.
  • Override data type(s) with doubles - If checked, the output data type is overridden with doubles.
  • Log minimums and maximums - If checked, minimum and maximum simulation values are logged to the workspace.

Look-up Methods

The block generates output based on the input values using one of these methods selected from the Method parameter list:

  • Interpolation-Extrapolation - Performs linear interpolation and extrapolation of the inputs.
    • If a value matches the block's input, the output is the corresponding element in the output vector.
    • If no value matches the block's input, then the block performs linear interpolation between the two appropriate elements of the table to determine an output value. If the block input is less than the first or greater than the last input vector element, then the block extrapolates using the first two or last two points.
  • Interpolation-Use End Values - Performs linear interpolation but does not extrapolate outside the end points of the input vector. Instead, the end-point values are used.
  • Use Input Nearest - Does not interpolate or extrapolate. Instead, the element in x nearest the current input is found. The corresponding element in y is then used as the output.
  • Use Input Below - Does not interpolate or extrapolate. Instead, the element in x nearest and below the current input is found. The corresponding element in y is then used as the output. If there is no element in x below the current input, then the nearest element is found.
  • Use Input Above - Does not interpolate or extrapolate. Instead, the element in x nearest and above the current input is found. The corresponding element in y is then used as the output. If there is no element in x above the current input, then the nearest element is found.

Characteristics

Characteristic Description
Input Port Any data type supported by the blockset
Output Port Any data type supported by the blockset
Direct Feedthrough Yes
Sample Time Inherited
Scalar Expansion No
States 0
Vectorized Yes