Path: news.mathworks.com!not-for-mail
From: "Jason " <j_henderson44@REMOVEhotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Interpolating between 2 columns
Date: Tue, 26 Feb 2008 10:35:03 +0000 (UTC)
Organization: Fluid Gravity Engineeing Ltd
Lines: 49
Message-ID: <fq0q0n$hn$1@fred.mathworks.com>
References: <fpus0u$pgs$1@fred.mathworks.com> <fpuu0m$247$1@fred.mathworks.com> <fq0lan$k11$1@fred.mathworks.com>
Reply-To: "Jason " <j_henderson44@REMOVEhotmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1204022103 567 172.30.248.38 (26 Feb 2008 10:35:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 26 Feb 2008 10:35:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 992326
Xref: news.mathworks.com comp.soft-sys.matlab:453679



"Jason " <j_henderson44@REMOVEhotmail.com> wrote in message
<fq0lan$k11$1@fred.mathworks.com>...
> "John D'Errico" <woodchips@rochester.rr.com> wrote in 
> > 
> > Z = [10 11 12 13;20 21 22 23;30 31 32 33]';
> > 
> > z25 = interp2(1:3,1:4,Z,2.5,1:4)
> > z25 =
> >     25
> >     26
> >     27
> >     28
> > 
> > HTH,
> > John
> 
> John,
> 
> Thank you for the answer. I should learn to post the more
> difficult part of the problem from the start on here ;-) I
> always start from a simple problem to understand what is
> happening. 
> 
> I see you have added an additional row to give the
> interpolation matrix that is equally spaced between columns.
> 
> My real problem is that: 
> 
> my column data is not equally spaced as your additional
> column makes it.
> 
> ie X1 = [20 21 22 23] at 17
> 
>    X2 = [30 31 32 33] at 20
> 
> Jason

Ok sorry for the question above. I guess I just need to
redefine the input value as a fraction of 2 and 3. Is this
the best/most logical way? It works but I am keen to follow
good convention. 

Z = [20 21 22 23;30 31 32 33]';
 
z25 = interp2(1:2,1:4,Z,fraction,1:4)

Jason