Path: news.mathworks.com!not-for-mail
From: "Jose Miguel " <josemijauregui@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Interpolation with coordinates
Date: Mon, 28 May 2012 19:43:06 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 40
Message-ID: <jq0kga$q8i$1@newscl01ah.mathworks.com>
References: <jpvov1$ae2$1@newscl01ah.mathworks.com> <jq035b$jqr$1@newscl01ah.mathworks.com> <jq04pr$poc$1@newscl01ah.mathworks.com> <jq0a2j$ge4$1@newscl01ah.mathworks.com>
Reply-To: "Jose Miguel " <josemijauregui@hotmail.com>
NNTP-Posting-Host: www-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1338234186 26898 172.30.248.37 (28 May 2012 19:43:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 28 May 2012 19:43:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1468024
Xref: news.mathworks.com comp.soft-sys.matlab:769233

Thank you very much Roger,

I've applied the equations you mentioned and it seems to work perfectly.
I'm having though slightly different results than the ones obtained with matlab function griddada (I had to do an iteration for each row, so it was not an option).

Nevertheless for one point:
These are the coordinates of u1, u2, u3 and u4
         42.86        356.25 
         44.76        356.25
         42.86        358.13
         44.76        358.13
This is the coordinates of the point: x0=42.56, y0=356.84
u1=17.53
u2=20.37
u3=20.60
u4=16.19
The result I obtain with your equations is:
u0=18.44
With the matlab griddata function I obtained:
u0=18.46

But for the v0 point
v1=-10.24
v2=-9.72
v3=-10.05
v4=-6.54
The result I obtain with your equations is:
v0=-10.24
With the matlab griddata function I obtained:
v0=-8.38
Which is really quite a difference,

There must be something I'm doing wrongly,
The code I'm using to calculate v0 is
A = (v4-v3-v2+v1)./((x2-x1).*(y3-y1));
B = (v2-v1)./(x2-x1);
C = (v3-v1)./(y3-y1);
D = v1;
serieintv = A.*(x0-x1).*(y0-y1) + B.*(x0-x1) + C.*(y0-y1) + D;
clear A B C D