FILLNANS
by Ian Howat
15 Jul 2007
(Updated 18 Jul 2007)
FILLNANS replaces all NaNs in array using inverse-distance weighting between non-NaN values.
|
Watch this File
|
| File Information |
| Description |
FILLNANS replaces all NaNs in array using inverse-distance weighting.
Y = FILLNANS(X) replaces all NaNs in the vector or array X by inverse-distance weighted interpolation:
Y = sum(X/D^3)/sum(1/D^3)
where D is the distance (in pixels) from the NaN node to all non-NaN values X. Values farther from a known non-NaN value will tend toward the average of all the values.
Y = FILLNANS(...,'power',p) uses a power of p in the weighting function. The higher the value of p, the stronger the weighting.
Y = FILLNANS(...,'radius',d) only used pixels < d pixels away for weighted averaging.
NOTE: Use in conjunction with INVDISTGRID to grid and interpolate x,y,z data.
See also INPAINT_NANS |
| 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 (9) |
| 16 Jul 2007 |
John D'Errico
|
|
|
| 16 Jul 2007 |
Ian Howat
|
|
|
| 16 Jul 2007 |
John D'Errico
|
|
|
| 18 Jul 2007 |
Ian Howat
|
|
|
| 19 Jul 2007 |
John D'Errico
|
|
|
| 19 May 2008 |
Janusz Janiczek
|
|
|
| 05 Jun 2011 |
Alejandra Botero
|
|
|
| 05 Jun 2011 |
Alejandra Botero
|
|
|
| 05 Jun 2011 |
Alejandra Botero
|
|
|
| Updates |
| 16 Jul 2007 |
Replaced missing function call. This fixes the error:
>> X = fillnans(A); ??? Undefined function or method 'vsum' for input arguments of type 'double'. Error in ==> fillnans at 34 D = vsum(rn(k)-r,cn(k)-c); |
| 17 Jul 2007 |
Added radius option and 'option',value varargin parser.
Added increment expression to waitbar to reduce number of times its called.
Provided by John D'Errico. |
| 18 Jul 2007 |
Adopted several code efficiency revisions made by Urs, including removing the waitbar. |
| 18 Jul 2007 |
Adopted several code efficiency revisions made by Urs, including removing the waitbar. |
|
Contact us at files@mathworks.com