Map Using Prelookup
R2026bUse previously calculated index and fraction values to accelerate approximation of two-dimensional function
Map Using Prelookup block

To add a block to a model, double-click the canvas and start typing the block name. Then, select the block from the list.
Libraries:
AUTOSAR Blockset /
Classic Platform /
Library Routines /
Interpolation
Description
The Map Using Prelookup block uses the calculated index and fraction values from Prelookup blocks to interpolate a two-dimensional (2-D) lookup table, which represents sampled values of an approximated function. The output of this block is the result of the approximated function using the current inputs.
If you select the AUTOSAR 4.x code replacement library (CRL) for your AUTOSAR model, code generated from this block is replaced with the AUTOSAR library routine that you configure in the block parameters dialog box.
Examples
AUTOSAR Code Replacement Library Example for IFX and IFL Function Replacement
The Code Replacement Viewer lists AUTOSAR floating-point interpolation (IFL) and fixed-point interpolation (IFX) library routines that you can generate in lookup table C code. For replacing lookup table C code with IFL or IFX library routines, AUTOSAR Blockset provides lookup table blocks that are pre-configured for AUTOSAR code generation. You insert a block such as Curve, or Map in your model, then open the block dialog box and configure the block to generate a specific interpolation routine required by your design. For more information, see Configure Lookup Tables for AUTOSAR Calibration and Measurement.
Ports
Input
Input to the kf1 port containing index k and
fraction f, specified as a scalar, vector, or matrix with one of
these bus data types:
Ifl_DPResultF32_Type— WhenTargeted Routine Libraryis set toIFL (floating-point).Ifx_DPResultU16_Type— WhenTargeted Routine Libraryis set toIFX (fixed-point).
Data Types: Ifl_DPResultF32_Type | Ifx_DPResultU16_Type
Input to the kf2 port containing index k and
fraction f, specified as a scalar, vector, or matrix with one of
these bus data types:
Ifl_DPResultF32_Type— WhenTargeted Routine Libraryis set toIFL (floating-point).Ifx_DPResultU16_Type— WhenTargeted Routine Libraryis set toIFX (fixed-point).
Data Types: Ifl_DPResultF32_Type | Ifx_DPResultU16_Type
Output
Approximation of the two-dimensional function computed by interpolating table data
that uses values from the input index, k, and the fraction,
f.
When Targeted Routine Library is set to IFL
(floating-point) then the only valid data type is
single.
When Targeted Routine Library is set to IFX
(fixed-point) then you can the values of the Port 1
can be one of these data types: int8, uint8,
int16, uint16, int32,
uint32, and fixed-point data types.
Data Types: single | int8 | uint8 | int16 | uint16 | int32 | uint32 | fixed point
Parameters
To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.
If you select the AUTOSAR 4.x code replacement library (CRL) for your model, code generated from this block is replaced from the selected AUTOSAR routine library. This parameter enables you to choose either fixed-point (IFX) or floating-point (IFL) code replacement and validation checks.
Programmatic Use
Block Parameter:
TargetRoutineLibrary |
| Type: character vector | string |
Values:'IFL (floating-point)' | 'IFX
(fixed-point)' |
This parameter is read-only.
This parameter reflects the name of the AUTOSAR code replacement library (CRL) routine used to replace the code generated by this block. The naming convention includes the targeted routine library and interpolation method.
Dependencies
When the
Targeted Routine Libraryis set toIFX (fixed-point)the value defaults toIfx_IpoMap.When the
Targeted Routine Libraryis set toIFL (floating-point)the value defaults toIfl_IpoMap.
Programmatic Use
Block Parameter:
TargetedRoutine |
| Type: character vector |
Values:'Ifx_IpoMap' |
'Ifl_IpoMap' |
Table Specification
Specify whether to enter table data directly or use a lookup table object. If you set this parameter to:
Explicit values, the Table Data parameter and the Data Types tab are visible in the dialog box.Lookup table object, the Name parameter is visible in the dialog box.
Programmatic Use
Block Parameter:
TableSpecification |
| Type: character vector | string |
Values:
"Explicit values" | "Lookup table object" |
Default:
"Explicit values" |
Specify the name of a Simulink.LookupTable object. The
Simulink.LookupTable object references the
Simulink.Breakpoint objects specified in the
Prelookup blocks. If a Simulink.LookupTable object
does not exist, click the action button
and select Create. The
corresponding parameters of the new Simulink.LookupTable object are
populated with the block information.
Dependencies
To enable this parameter, set Data Specification to
Lookup table object.
Programmatic Use
Block Parameter:
LookupTableObject |
| Type: character vector |
Value:
Simulink.LookupTable object |
Default:
'[]' |
Table of output values, specified as a two-dimensional matrix. The dimensions of the specified lookup table object or table data, must be consistent with the breakpoint objects or data sets specified in the Prelookup blocks used by the Map Using Prelookup block.
During simulation, the matrix must be two-dimensional. However, during block
diagram editing, you can enter an empty matrix (specified as []) or
an undefined workspace variable. This technique lets you postpone specifying a
correctly dimensioned matrix for the table data and continue editing the block
diagram.
Dependencies
To enable this parameter, set Data specification to
Explicit values.
Programmatic Use
Block Parameter:
Table |
| Type: character vector |
| Values: matrix of table values |
Default:
'[4 5 6;16 19 20;10 18 23]' |
Click this button to open the Lookup Table Editor.
Algorithm
Specify the method that the block uses to interpolate table data. You can select
Linear point-slope, Flat, or
Nearest. For more information regarding these methods, see Interpolation Methods.
Programmatic Use
Block Parameter:
InterpMode |
| Type: character vector | string |
Values:
"Flat" | "Linear point-slope" | "Nearest" |
Default:
"Linear point-slope" |
Data Types
To enable this tab, on the Table Specification tab, set
Data Specification to Explicit
values.
Specify the table data type. The block will validate that the selected types are compatible with the specification of the targeted routine.
When Targeted Routine Library is set to IFL
(floating-point) then the only valid data type is
single.
When the Targeted Routine Library is set to IFX
(fixed-point) you can set the table data type to:
Rules that inherit a data type:
Inherit: Same as output,Inherit: Inherit from 'Table data'.One of these built-in data types:
int8,uint8,int16,uint16,int32,uint32.The name of a data type object, for example, a
Simulink.NumericTypeobject.An expression that evaluates to a data type. For example, the software provides these fixed-point data type expressions:
fixdt(1,16),fixdt(1,16,0), orfixdt(1,16,2^0,0).
Click the Show data type
assistant button
to display the Data Type
Assistant, which helps you set the data type attributes. For more
information, see Specify Data Types Using Data Type Assistant.
Programmatic Use
Block Parameter:
TableDataTypeStr |
| Type: character vector | string |
Values:
"Inherit: Inherit from 'Table data'" | "Inherit: Same as output" |
"single" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" |
"fixdt(1,16)" | "fixdt(1,16,0)" | "fixdt(1,16,2^0,0)" | "<data type
expression>" |
Default:
"Inherit: Same as output" |
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2019aInteger rounding mode is set to "Zero"
and hidden by default because only "Zero" is
supported for AUTOSAR 4.x and host libraries for SIL testing.
Starting in 25a, the AUTOSAR code replacement library supports AUTOSAR schema versions
after AUTOSAR 4.0. To use the latest AUTOSAR routines, in the model Configuration Parameters
dialog box in the Code Generation > Interface pane, specify Code replacement libraries as
AUTOSAR 4.x.
See Also
Objects
Blocks
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
