Home > hfrc > matlab > utility > interp2Scattered.m

interp2Scattered

PURPOSE ^

INTERP2SCATTERED - Interpolate scattered data at individual points.

SYNOPSIS ^

function ZI = interp2Scattered( x, y, z, XI, YI, method, tri )

DESCRIPTION ^

 INTERP2SCATTERED - Interpolate scattered data at individual points.

 This function interpolates scattered data at individual points.  It
 uses delaunay triangulation and linear interpolation.  It is not unlike
 interp2, except that the XI and YI don't have to be matrices.  They can
 be vectors of points with no particular ordering.

 Usage: ZI = interp2Scattered( x, y, z, XI, YI )
        ZI = interp2Scattered( x, y, z, XI, YI, method )
        ZI = interp2Scattered( x, y, z, XI, YI, method, tri )

 Currently method can be one of two strings: 'linear' (the default),
 'nearest'.  Linear is two dimensional linear interpolation with
 triangles.  nearest is just nearest neighbor interpolation.  There is
 also an 'old' method, which is the original algorithm I used which
 calculates the normals.  This method does not always pass through the
 data points if NaN's are present and is discouraged.

 tri specifies the triangulation to use.  If left off or empty, delaunay
 will be used.  This argument is principally for repeated faster calls to
 interp2Scattered.  If given, no checking will be done for identical x-y
 pairs.

 This function basically copies the methods used in griddata - a ripoff.
 That is why it is NOT GPL licensed.  The 

 Note: colinear data could screw up this calculation.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

     $Id: interp2Scattered.m,v 1.8 2002-08-13 00:09:05 dmk Exp $    

 Copyright (C) 2001 David M. Kaplan
 Copyright 1984-2001 The MathWorks, Inc. (parts from griddata function).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Mon 18-Dec-2006 07:26:46 by m2html © 2003