Curve Using Prelookup
Use previously calculated index and fraction values to accelerate approximation of one-dimensional function
Libraries:
AUTOSAR Blockset /
Classic Platform /
Library Routines /
Interpolation
Description
The Curve Using Prelookup block is intended for use with a Prelookup block.
This block enables a prelookup result to drive multiple interpolation results. The
Prelookup block computes the index and interval fraction that specify how its
input value u
relates to the breakpoint data set and feeds the resulting
index and fraction values into the Curve Using Prelookup block to interpolate a
one-dimensional table. The Prelookup and Curve Using Prelookup
blocks have distributed algorithms that when used together perform the same algorithm
operation as the Curve block but offer greater flexibility and more efficient
simulation and code generation.
If you select the AUTOSAR 4.0 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.
Ports
Input
kf1 — Input containing index k
and fraction
f
bus object
Inputs to the kf1 port contain index k
and
fraction f
specified as a bus object.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
| fixed point
| bus
T — Table data
scalar | vector | matrix | 1-d array
Table data values provided as input to port T. These table
values correspond to the breakpoint data sets specified in Prelookup blocks. The
Interpolation Using Prelookup block generates output by looking up or estimating table
values based on index (k
) and interval fraction
(f
) values fed from Prelookup blocks.
Dependencies
To enable this port, set Source to Input
port
.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
| fixed point
Output
Port 1 — Approximation of one-dimensional function
scalar | vector | matrix
Approximation of the one-dimensional function computed by interpolating table data
that uses values from the input index, k
, and the fraction,
f
.
Data Types: single
| double
| int8
| int16
| int32
| uint8
| uint16
| uint32
| fixed point
Parameters
Targeted Routine Library — Indicates the AUTOSAR routine library used for block code replacement
IFX(fixed-point) (default) | IFL(floating-point)
If you select the AUTOSAR 4.0 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.
Targeted Routine — AUTOSAR library routine used for code replacement
Ifx_IpoCur
(default)
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, interpolation method, and block type. This parameter is reference-only and must not be edited.
Table Specification
Data Specification — Choose how to enter table data
Explicit values
(default) | Lookup table object
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 is 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 |
Values:
'Explicit values' | 'Lookup table object' |
Default:
'Explicit values' |
Name — Name of a Simulink.LookupTable
object
Simulink.LookupTable object
Specify the name of a Simulink.LookupTable
object. A lookup table object references Simulink® breakpoint objects. If a Simulink.LookupTable
object does not exist, click the action button
and select Create. The
corresponding parameters of the new lookup table 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 data — Define the table of output values
[1 2 4]
(default) | character vector
Enter the table of output values.
During simulation, the matrix size must be one-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
Table and breakpoints
.
Programmatic Use
Block Parameter:
Table |
Type: character vector |
Values: matrix of table values |
Default:
'[1 2 4]' |
Edit table and breakpoints — Launch Lookup Table Editor dialog box
button
Click this button to open the Lookup Table Editor. For more information, see Edit Lookup Tables in the Simulink documentation.
Clicking this button for a lookup table object lets you edit the object and save the new values for the object.
Algorithm
Interpolation method — Select Linear point-slope
or Flat
interpolation methods
Linear point-slope
(default) | Flat
Specify the method that the block uses to interpolate table data. You can select
Linear point-slope
or Flat
. For more
information, see Interpolation Methods.
Programmatic Use
Block Parameter:
InterpMethod |
Type: character vector |
Values:
'Flat' | 'Linear point-slope' |
Default:
'Linear point-slope' |
Integer rounding mode — Rounding mode for fixed-point operations
Round
(default) | Zero
Specify the rounding mode for fixed-point or floating-point lookup table calculations that occur during simulation or execution of code generated from the model.
This option does not affect rounding of values of block parameters. Simulink rounds such values to the nearest representable integer value. To control the rounding of a block parameter, enter an expression using a MATLAB™ rounding function into the edit field on the block dialog box.
Programmatic Use
Block Parameter:
RndMeth |
Type: character vector |
Values:
'Round' | 'Zero' |
Default:
'Round' |
Data Types
Table data — Data type of table data
Inherit: Same as output
(default) | double
| single
| int8
| uint8
| int16
| uint16
| int32
| uint32
| fixdt(1,16)
| fixdt(1,16,0)
| fixdt(1,16,2^0,0)
| <data type expression>
Specify the table data type. The block validates that the selected types are compatible with the specification of the targeted routine. You can set it to:
A rule that inherits a data type, for example,
Inherit: Same as output
The name of a built-in data type, for example,
single
The name of a data type object, for example, a
Simulink.NumericType
objectAn expression that evaluates to a data type, for example,
fixdt(1,16,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.
Tip
Specify a table data type different from the output data type for these cases:
Lower memory requirement for storing table data that uses a smaller type than the output signal
Sharing of prescaled table data between two Curve blocks with different output data types
Sharing of custom storage table data in the generated code for blocks with different output data types
Programmatic Use
Block Parameter:
TableDataTypeStr |
Type: character vector |
Values:
'Inherit: Inherit from 'Table data'' | 'Inherit: Same as output' |
'double' | '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 R2019a
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)