[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 4D interpolation
From: |
Eric S Fraga |
Subject: |
Re: 4D interpolation |
Date: |
Thu, 03 Jul 2008 18:04:48 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Ben Abbott <address@hidden> writes:
> On Jul 3, 2008, at 11:31 AM, Eric S Fraga <address@hidden> 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