From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I get an interpolated scalar value from a 2D lookup table z=f(x,y)?

I have a table of numerical values.  Rows correspond to discrete values of a parameter, columns to discrete values of a second parameter.  I want tin interpolate a scalar value from the table :

Table Z = f(X,Y)

find Zi,j corresponding to specified X and Y values (which may not be the exact discrete valuescorresponding to rows and columns).

 

So, I want to find Z(1.5, 3) from a table

 

    X    1      2     3

Y

2       10   15    20

4        50   60   70

 

The results would be Z = 33.75

 

The LUT routines interpolate an entire table rather than giving a single answer.  earlier discussions have posted routines that find the nearest table entry but do not interpolate between entries.

 

This sounds very simple....

Thanks.

Message 1 of 3
(3,001 Views)

Have a look at the bilinear interpolation examples quoted in the various links of this idea.

 

(Use threshold array to get the fractional array index from the axis mapping)

Message 2 of 3
(2,987 Views)

Thanks!  The function is exactly what I was looking for.

0 Kudos
Message 3 of 3
(2,955 Views)