Fixed-Point Blockset | ![]() ![]() |
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. Also, the x
and y
data vectors must be strictly monotonically increasing as described in the FixPt Look-Up Table reference pages.
The Row parameter is a 1-by-m vector of x
data points, the Col parameter is a 1-by-n vector of y
data points, and the Table parameter is an m-by-n matrix of z
data points. Both the row and column vectors must be strictly monotonically increasing. The block generates output based on the input values using one of these methods selected from the Method parameter list:
Interpolation-Extrapolation
- This is the default method; it performs linear interpolation and extrapolation of the inputs.Interpolation-Use End Values
- This method performs linear interpolation as described above but does not extrapolate outside the end points of the input vector. Instead, the end-point values are used.Use Input Nearest
- This method 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
- This method 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
- This method 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.For a detailed description of all other block parameters, refer to Block Parameters.
Remarks
To avoid parameter saturation errors, the automatic scaling script autofixexp
employs a special rule for the FixPt Look-Up Table (2D) block. autofixexp
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 Table parameter (the TableDataPoints
variable).
Parameters and Dialog Box
Conversions
The Row parameter is converted from doubles to the first input's data type. The Column parameter is converted from doubles to the second input's data type. The Table parameter is converted from doubles to the output data type. All conversion are performed offline using round-to-nearest and saturation. Refer to Parameter Conversions for more information about parameter conversions.
Example
Suppose the FixPt Look-Up Table (2D) block is configured to use input row and column vectors given by [1:3]
, and a look-up table given by [4 5 6; 16 19 20; 10 18 23]
. Using the model shown below,
the following results were generated.
Characteristics
![]() | FixPt Look-Up Table | FixPt Matrix Gain | ![]() |