Prev: Boxplot question`
Next: merging matrices in loop
From: Bjorn Gustavsson on 24 Jun 2010 14:23 Hello, I have a situation where I would like to build a 2-D Delaunay triangulation from scattered points (x,y), and then interpolate to a regular grid. The hook is that I would like to do the triangulation once and the be able to use that for a range of arrays for z: tri = delaunay(x,y); [X,Y] = meshgrid(linspace(min(x),max(x),Nx),linspace(min(y),max(y),Ny)); Z{1} = tri_interp(tri,z1,X,Y); Z{2} = tri_interp(tri,z2,X,Y); .... Z{nZ} = tri_interp(tri,zn,X,Y); I recall that griddata could take the output from delaunay and thus reuse the triangulation. In my current version (R2008a) this does not seem to be the case. Is there some other function that does this. Does someone know where such a function is available. I could not find it with a search on the FEX. Hoping for help, Bjeorn
From: Rune Allnor on 24 Jun 2010 16:00 On 24 Jun, 20:23, "Bjorn Gustavsson" <bj...(a)irf.se> wrote: > Hello, > > I have a situation where I would like to build a 2-D Delaunay triangulation from scattered points (x,y), and then interpolate to a regular grid. The hook is that I would like to do the triangulation once and the be able to use that for a range of arrays for z: > tri = delaunay(x,y); > [X,Y] = meshgrid(linspace(min(x),max(x),Nx),linspace(min(y),max(y),Ny)); > Z{1} = tri_interp(tri,z1,X,Y); > Z{2} = tri_interp(tri,z2,X,Y); > ... > Z{nZ} = tri_interp(tri,zn,X,Y); > I recall that griddata could take the output from delaunay and thus reuse the triangulation. In my current version (R2008a) this does not seem to be the case. Is there some other function that does this. The task is 'trivial' IFF the triangulation is prep'ed to be used with an efficient point location algorithm. In the matlab version you have available, that's not the case. Rune
|
Pages: 1 Prev: Boxplot question` Next: merging matrices in loop |