File Exchange

image thumbnail

nanmedfilt2

version 1.0 (1.55 KB) by

This MATLAB function performs median filtering of the matrix A in two dimensions while ignoring NaNs

13 Downloads

Updated

View License

This MATLAB function performs median filtering of the matrix A in two dimensions
while *ignoring* NaNs (based on discussions here
http://www.mathworks.com/matlabcentral/newsreader/view_thread/251787)

Comments and Ratings (1)

Chad Greene

Chad Greene (view profile)

This function is quite useful, and it's fast. I find that nanmedfilt2 takes roughly twice as long as the medfilt2 function found in the image processing toolbox. That's not perfect, but it's faster than any other manual solutions I have tried. I recommend changing line 9 to sz=3 to match the default 3-by-3 neighborhood of medfilt2.

MATLAB Release
MATLAB 8.1 (R2013a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video