|
"Jason " <j_henderson44@REMOVEhotmail.com> wrote in message
<fq0q0n$hn$1@fred.mathworks.com>...
> "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)
Interp2 does not need equal spacing, and
I could have written it with only two columns.
I misinterpreted your original question, so
for some silly reason I added a column.
Z = [20 21 22 23;30 31 32 33]';
z25 = interp2([17 20],1:4,Z,18.5,1:4)
John
|