Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: multi-object interpolate
Replies: 3   Last Post: Nov 16, 2012 9:50 AM

 Messages: [ Previous | Next ]
 Ha Posts: 93 Registered: 11/30/09
multi-object interpolate
Posted: Nov 15, 2012 1:09 PM

I don't know if the title is correct for my question. Below is a simple example to illustrate my problem.

x = -5:5;
y = -5:5;

[X Y] = meshgrid(x,y);

Z1 = [
7.1 6.4 5.8 5.4 5.1 5.0 5.1 5.4 5.8 6.4 7.1
6.4 5.7 5.0 4.5 4.1 4.0 4.1 4.5 5.0 5.7 6.4
5.8 5.0 4.2 3.6 3.2 3.0 3.2 3.6 4.2 5.0 5.8
5.4 4.5 3.6 2.8 2.2 2.0 2.2 2.8 3.6 4.5 5.4
5.1 4.1 3.2 2.2 1.4 1.0 1.4 2.2 3.2 4.1 5.1
5.0 4.0 3.0 2.0 1.0 0.0 1.0 2.0 3.0 4.0 5.0
5.1 4.1 3.2 2.2 1.4 1.0 1.4 2.2 3.2 4.1 5.1
5.4 4.5 3.6 2.8 2.2 2.0 2.2 2.8 3.6 4.5 5.4
5.8 5.0 4.2 3.6 3.2 3.0 3.2 3.6 4.2 5.0 5.8
6.4 5.7 5.0 4.5 4.1 4.0 4.1 4.5 5.0 5.7 6.4
7.1 6.4 5.8 5.4 5.1 5.0 5.1 5.4 5.8 6.4 7.1 ];

Z2 = [
0 1 2 3 4 5 6 7 8 9 10
-1 0 1 2 3 4 5 6 7 8 9
-2 -1 0 1 2 3 4 5 6 7 8
-3 -2 -1 0 1 2 3 4 5 6 7
-4 -3 -2 -1 0 1 2 3 4 5 6
-5 -4 -3 -2 -1 0 1 2 3 4 5
-6 -5 -4 -3 -2 -1 0 1 2 3 4
-7 -6 -5 -4 -3 -2 -1 0 1 2 3
-8 -7 -6 -5 -4 -3 -2 -1 0 1 2
-9 -8 -7 -6 -5 -4 -3 -2 -1 0 1
-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 ];

Now I have a table of Z1(X,Y) and a table of Z2(X,Y) and I wanna interpolate the values of x and y for given (z1, z2), e.g., providing (z1, z2) = (2.9, 1), (x, y) is expected to be (2.5, 1.5).

Any existing function or any solution?

Date Subject Author
11/15/12 Ha
11/15/12 Matt J
11/15/12 Ha
11/16/12 Matt J