Math

LookupTable Block

1-D lookup table with linear interpolation. Maps input values to output values using breakpoints and corresponding table data.

Open LookupTable in BlockWerk →

Description

# Lookup Table

1-D lookup table with linear interpolation. Maps input values to output values using a set of breakpoints and corresponding table data.

Mathematical Model

Given breakpoints x₀ < x₁ < ... < xₙ and table values y₀, y₁, ..., yₙ:

y = y_i + (y_{i+1} - y_i) \frac{x - x_i}{x_{i+1} - x_i}

Extrapolation:

Parameters

| Parameter | Type | Default | Description | | ------------- | ------ | --------- | ------------------------------------------------------------------------------------- | | breakpoints | text | "0 1 2 3" | Space-separated list of input breakpoints (must be monotonically increasing) | | tableData | text | "0 1 4 9" | Space-separated list of output values (must match breakpoints length) | | extrapolation | select | clip | Behaviour outside breakpoint range: clip (hold endpoints) or linear (extrapolate) |

breakpoints

Type: text (Default: "0 1 2 3")

Breakpoints parameter description placeholder.

tableData

Type: text (Default: "0 1 4 9")

Table Data parameter description placeholder.

extrapolation

Type: select (Default: "clip")

How to handle input values outside the range of breakpoints.

interpolation

Type: select (Default: "linear")

Interpolation method to use. Options: Linear, Spline.

Ports

Behaviour

Remarks

Examples

With breakpoints 0 1 2 3 and table data 0 1 4 9:

See Also