Skip to content

FixPt Look-Up Table (2D)

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

Description

The FixPt Look-Up Table (2-D) block is a masked S-function that computes an approximation to some function z=f(x,y) given x, y, z data points. The look-up method can use interpolation, extrapolation, or the original values of the inputs. The x and y data vectors must be strictly monotonically increasing as described in the FixPt Look-Up Table reference pages.

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 table (the TableDataPoints variable).

Dialog Box Parameters

  • Row - A 1-by-m input vector of x data points, which must be strictly monotonically increasing.
  • Col - A 1-by-n input vector of y data points, which must be strictly monotonically increasing.
  • Table - An m-by-n output matrix of z data points, which must match the size defined by the input row and column vectors.
  • 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 the inputs match row and column parameter values, the output is the value at the intersection of the row and column.
    • If the inputs do not match row and column parameter values, then the block generates output by linearly interpolating between the appropriate row and column values. If either or both block inputs are less than the first or greater than the last row or column values, the block extrapolates from 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 elements in x and y nearest the current inputs are found. The corresponding element in z is then used as the output.
  • Use Input Below - Does not interpolate or extrapolate. Instead, the elements in x and y nearest and below the current inputs are found. The corresponding element in z is then used as the output.If there are no elements in x or y below the current inputs, then the nearest elements are found.
  • Use Input Above - Does not interpolate or extrapolate. Instead, the elements in x and y nearest and above the current inputs are found. The corresponding element in z is then used as the output. If there are no elements in x or y above the current inputs, then the nearest elements are 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 Of one input if the other is a vector
States 0
Vectorized Yes