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 →

# 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ₙ:

For xᵢ ≤ x ≤ xᵢ₊₁:
  output = yᵢ + (yᵢ₊₁ - yᵢ) · (x - xᵢ) / (xᵢ₊₁ - xᵢ)

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) |

Ports

Behaviour

Remarks

Examples

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