4D interpolation
Eric S Fraga
e.fraga at ucl.ac.uk
Thu Jul 3 12:04:48 CDT 2008
Ben Abbott <bpabbott at mac.com> writes:
> On Jul 3, 2008, at 11:31 AM, Eric S Fraga <e.fraga at ucl.ac.uk> wrote:
>
>> I've been following the brief thread on interpolation with interest.
>> Very helpful.
>>
>> However, I have a problem in which I need to interpolate (2d only)
>> onto a surface that is not square. Given interp2:
>>
>> ZI = interp2 (X, Y, Z, XI, YI)
>>
>> I wish to interpolate (or maybe, if need be, approximate) Z to get ZI
>> where XI and YI are not the same size. And neither are the original X
>> and Y for that matter. interp2 does not allow this. Can anybody
>> please suggest an alternative?
>>
>
> By not the same size I assume you are implying X & Y are vectors, and
> Z is a 2D array?
>
> If so check out meshgrid or ndgrid.
>
> Ben
By not the same size, I meant that size(XI) != size(YI). Pointing me
to meshgrid was very helpful as it's made me realise that XI and YI
need to be matrices. I had thought they could be vectors as X and Y
are. Using meshgrid to create XI and YI (from my original vectors)
gives me what I need and interp2 does the job.
Many thanks for the pointer and for the very speedy response!
eric
More information about the Help-octave
mailing list