help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [CHANGESET] Re: Help with griddata3


From: David Bateman
Subject: Re: [CHANGESET] Re: Help with griddata3
Date: Wed, 12 Mar 2008 18:26:49 +0100
User-agent: Thunderbird 2.0.0.12 (X11/20080306)

António Santos wrote:
> Hi,
>
> It solved the problem but the function seems to not return valid data,
> only NaNs.
> I tried this:
>
> rand('state',0);
> x = 2*rand(5,1)-1;
> y = 2*rand(5,1)-1;
> z = 2*rand(5,1)-1;
> v = x.^2 + y.^2 + z.^2;
> d = -0.8:0.05:0.8;
> [xi,yi,zi] = meshgrid(d,d,d);
> w = griddata3(x,y,z,v,xi,yi,zi)
>
> w only contains NaNs...Is anyone experiencing this problem too? Or am
> I doing something wrong?
>
> Thanks,
Yes, you are doing something wrong.. The Delaunay Tesselation in 3D
requires 4 points per simplex. Therefore with 5 per points of data you
have only two Dealaunay simplices defined.. In 3D these are tetrahedra,
and with random data they are going to be often long and thin, and in
the case above all of the data falls outside the tetrahedra and there is
therefore no data to interpolate with. Replace 5 with 1000 above and it
should work.

D.


-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



reply via email to

[Prev in Thread] Current Thread [Next in Thread]