Simulink Reference    
Look-Up Table (2-D)

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

Library

Simulink Look-Up Tables and Fixed-Point Blockset LookUp

Description

The Look-Up Table (2-D) block computes an approximation to some function z=f(x,y) given x, y, z data points.

The Row index input values parameter is a 1-by-m vector of x data points, the Column index input values parameter is a 1-by-n vector of y data points, and the Matrix of output values parameter is an m-by-n matrix of z data points. Both the row and column vectors must be monotonically increasing. These vectors must be strictly monotonically increasing in the following cases:

The block generates output based on the input values using one of these methods selected from the Look-up method parameter list:

To avoid parameter saturation errors, the automatic scaling script autofixexp employs a special rule for the Look-Up Table (2-D) block. autofixexp modifies the scaling by using the output look-up values in addition to the logged minimum and maximum simulation values. The output look-up values are converted to the specified output data type. This prevents the data from being saturated to different values.

When the Show additional parameters check box is selected, some of the parameters that become visible are common to many blocks. For a detailed description of these parameters, refer to Block Parameters in the Fixed-Point Blockset documentation.

Parameters and Dialog Box

Row index input values
The row values for the table, entered as a vector. The vector values must increase monotonically.
Column index input values
The column values for the table, entered as a vector. The vector values must increase monotonically.
Matrix of output values
The table of output values. The matrix size must match the dimensions defined by the Row and Column parameters.
Show additional parameters
If selected, additional parameters specific to implementation of the block become visible as shown.

Look-up method
Specify the lookup method. See Description for a discussion of the options for this parameter.
Require all inputs to have same data type
Select to require all inputs to have the same data type.
Output data type mode
You can set the output signal to a built-in data type from this drop-down list, or you can choose the output data type and scaling to be the same as the input. Alternatively, you can choose to inherit the output data type and scaling by backpropagation. Lastly, if you choose Specify via dialog, the Output data type, Output scaling value, and Lock output scaling against changes by the autoscaling tool parameters become visible.
Output data type
Specify any data type, including fixed-point data types. This parameter is only visible if Specify via dialog is selected for the Output data type mode parameter.
Output scaling value
Set the output scaling using radix point-only or [Slope Bias] scaling. This parameter is only visible if Specify via dialog is selected for the Output data type mode parameter.
Lock output scaling against changes by the autoscaling tool
If selected, scaling of outputs is locked. This parameter is only visible if Specify via dialog is selected for the Output data type mode parameter.
Round integer calculations toward
Select the rounding mode for the fixed-point output.
Saturate on integer overflow
If selected, overflows saturate.

Examples

In this example, the block parameters are defined as

The first figure shows the block outputting a value at the intersection of block inputs that match row and column values. The first input is 1 and the second input is 4. These values select the table value at the intersection of the first row (row parameter value 1) and second column (column parameter value 4).

In the second figure, the first input is 1.7 and the second is 3.4. These values cause the block to interpolate between row and column values, as shown in the table at the left. The value at the intersection (28) is the output value.

Characteristics

Dimensionalized
Yes
Direct Feedthrough
Yes
Sample Time
Inherited from driving blocks
Scalar Expansion
Of one input if the other is a vector
Zero Crossing
No

See Also

Look-Up Table, Look-Up Table (n-D)


  Look-Up Table Look-Up Table (n-D)