Interpolation Using Prelookup - Use output of Prelookup block to accelerate approximation of N-dimensional function

Library

Lookup Tables

Description

The Interpolation Using Prelookup block is intended for use with the Prelookup block. The Prelookup block calculates the index and interval fraction that specifies how its input value relates to the breakpoint data set. You feed the resulting index and fraction values into an Interpolation Using Prelookup block to interpolate an n-dimensional table. This combination of blocks performs the equivalent operation that a single instance of the Lookup Table (n-D) block performs. However, the Prelookup and Interpolation Using Prelookup blocks offer greater flexibility that can result in more efficient simulation performance.

To use this block, you must define a set of output values as the Table data parameter. In normal use, these table values correspond to the breakpoint data sets specified in Prelookup blocks. The Interpolation Using Prelookup block generates its output by looking up or estimating table values based on the index and interval fraction values (denoted on the block as k and f, respectively) fed into the block by each Prelookup block:

The Interpolation Using Prelookup block can perform interpolation on a portion of its table. The Number of sub-table selection dimensions parameter lets you specify that interpolation occur only on a subset of its Table data parameter. For example, if your 3-D table data constitutes a stack of 2-D tables to be interpolated, set the Number of sub-table selection dimensions parameter to 1. The block displays an input port (labeled as sel) used to select and interpolate the 2-D tables.

Data Type Support

The Interpolation Using Prelookup block accepts real signals of any numeric data type supported by Simulink software, except Boolean. The Interpolation Using Prelookup block supports fixed-point data types.

For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink in the Simulink documentation.

Parameters and Dialog Box

The Main pane of the Interpolation Using Prelookup block dialog appears as follows:

Number of table dimensions

The number of dimensions that the Table data parameter must have. This determines the number of independent variables for the table and hence the number of inputs to the block. Enter an integer between 1 and 30 into this field.

Table data

The table of output values. During simulation, the matrix size must match the dimensions defined by the Number of table dimensions parameter. But note that during block diagram editing, you can enter either an empty matrix (specified as []) or an undefined workspace variable as the Table data parameter. This allows you to postpone specifying a correctly dimensioned matrix for the Table data parameter and continue editing the block diagram. For information about how to construct multidimensional arrays in MATLAB, see Multidimensional Arrays in the MATLAB Programming Fundamentals documentation.

Click the Edit button to open the Lookup Table Editor (see Lookup Table Editor in the Simulink documentation).

Interpolation method

None - Flat or Linear. See Interpolation Methods in the Simulink documentation for more information.

Extrapolation method

None - Clip or Linear. See Extrapolation Methods in the Simulink documentation for more information. The Extrapolation method parameter is visible only if you select Linear as the Interpolation method parameter.

Action for out of range input

Specifies whether to produce a warning or error message if the input is out of range. The options are

Check index in generated code (Real-Time Workshop license required)

Specifies whether Real-Time Workshop software generates code that checks the validity of the index values fed to this block.

Valid index input may reach last index

Specifies how the index and interval fraction inputs to the block (labeled respectively as k and f on the block) access the last elements of the n-dimensional table specified by the Table data parameter. If enabled, the block returns the value of the last element in a particular dimension of its table when k indexes the last table element in the corresponding dimension and f is 0. If disabled, the block returns the value of the last element in a particular dimension of its table when k indexes the next-to-last table element in the corresponding dimension and f is 1. Note that index values are zero-based.

This parameter is visible only if the Interpolation method specifies Linear and the Extrapolation method is None - Clip.

Number of sub-table selection dimensions

Specifies the number of dimensions of the subtable used to compute this block's output. Specify 0 (the default) to interpolate the entire table, effectively disabling subtable selection.

Sample time

Specify the time interval between samples. To inherit the sample time, set this parameter to -1. See Specifying Sample Time in the Simulink documentation for more information.

The Signal Attributes pane of the Interpolation Using Prelookup block dialog appears as follows:

Output minimum

Specify the minimum value that the block should output. The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:

Output maximum

Specify the maximum value that the block should output. The default value, [], is equivalent to Inf. Simulink software uses this value to perform:

Output data type

Specify the output data type. You can set it to:

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Output data type parameter.

See Specifying Block Output Data Types for more information.

Lock output scaling against changes by the autoscaling tool

Select to lock scaling of outputs. This parameter is visible only if you enter an expression for the Output data type parameter.

Round integer calculations toward

Select the rounding mode for fixed-point operations. For more information, see Rounding in the Simulink Fixed Point User's Guide.

Block parameters such as Table data are always rounded to the nearest representable value. To control the rounding of a block parameter, enter an expression using a MATLAB rounding function into the mask field.

Characteristics

Direct Feedthrough

Yes

Sample Time

Specified in the Sample time parameter

Scalar Expansion

Yes

Dimensionalized

Yes

Zero Crossing

No

See Also

Prelookup

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS