Code covered by the BSD License  

Highlights from
INVDISTGRID

1.0

1.0 | 1 rating Rate this file 3 Downloads (last 30 days) File Size: 2.08 KB File ID: #15538
image thumbnail

INVDISTGRID

by Ian Howat

 

09 Jul 2007 (Updated 19 Jul 2007)

Simple, robust gridding using inverse-distance interpolation.

| Watch this File

File Information
Description

INVDISTGRID Simple, robust gridding using inverse-distance interpolation.
  [Xi,Yi,Zi] = invdistgrid[X,Y,Z,dx] Grids values in vector Z with coordinates X and Y into an array with spacing dx using inverse-distance weighting (default power =2). All data between grid points are used in weighting. If no data exists between points, a NaN is entered. X and Y must be vectors and Z must be of the same length. Z can be an m by n array, with each column a dataset, and Zi will be a three-dimensional array with n layers.
      
  [Xi,Yi,Zi] = invdistgrid[X,Y,Z,dx,p] Replaces the default weighting power 2 with the integer p. The higher the value of p, the more weight will be given to closer data values.

NOTE: You can use FILLNANS or INPAINT_NANS to fill in the NaN values in Zi.

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
16 Jul 2007 Andrew Stevens

Doesn't work as provided...

??? Undefined function or method 'vsum' for input arguments of type 'double'.

Error in ==> invdistgrid at 39
        D = repmat(vsum(XYZ(fs(k),1) - XYZ(fs(k):fe(k),3),...

16 Jul 2007 Ian Howat

This error comes from a call to a non-standard toolbox function. I've uploaded a corrected version. (Make sure the revision is noted on this page before re-uploading).

08 Apr 2011 James Ramm  
Please login to add a comment or rating.
Updates
16 Jul 2007

Replaced call to non-package function. Fixes the error:
??? Undefined function or method 'vsum' for input arguments of type 'double'.

Error in ==> invdistgrid at 39
D = repmat(vsum(XYZ(fs(k),1) - XYZ(fs(k):fe(k),3),...

16 Jul 2007

Removed non-package function call. Fixes fatal error:
??? Undefined function or method 'vsum' for input arguments of type 'double'.

Error in ==> invdistgrid at 39
D = repmat(vsum(XYZ(fs(k),1) - XYZ(fs(k):fe(k),3),...

16 Jul 2007

Replaces calls to non-standard toolbox functions. It should now work with the base MATLAB package.

19 Jul 2007

Corrected some errors in the description.

Tag Activity for this File
Tag Applied By Date/Time
gridding Ian Howat 22 Oct 2008 09:18:50
inverse distance Ian Howat 22 Oct 2008 09:18:50
earth sciences Ian Howat 22 Oct 2008 09:18:50
interpolation Ian Howat 22 Oct 2008 09:18:50
interpolation Kashi Telsang 20 Nov 2011 14:11:26

Contact us at files@mathworks.com