Code covered by the BSD License  

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

» Watch video

Highlights from
ndnanfilter.m

5.0
5.0 | 8 ratings Rate this file 28 Downloads (last 30 days) File Size: 16.3 KB File ID: #20417 Version: 1.0
image thumbnail

ndnanfilter.m

by

 

23 Jun 2008 (Updated )

Filter/smoothing of multidimensional data with an specified window function, ignoring NaNs.

| Watch this File

File Information
Description

NDNANFILTER N-dimensional zero-phase digital filter, ignoring NaNs.
 
SHORT SYNTAX:
[Y,W] = ndnanfilter(X,HWIN,F);
 
SHORT INPUT:
X - Multidimensional data with/without NaNs.
HWIN - Window's name (N-D moving average by default: 'rectwin').
F - Vector specifying the semi-width of the window for each dimension.
SHORT OUTPUT:
Y - Filtered/smoothed X data (same size as X!) with zero phase shift.
W - N-dimensional window with central symmetry generated by a special subfunction called NDWIND.
 
SHORT DESCRIPTION:
This function applies a N-dimensional convolution of X with W, using the MATLAB's IMFILTER or CONVN function, ignoring/interpolating/filling NaNs.

By default, the edges are padded with the values of X at the borders with the PADARRAY MATLAB's function. When PADARRAY is not found, the program performs zero-padding.

SHORT NOTE:
* See the screenshot.

Acknowledgements

Moving Average V3.1 (Mar 2008) inspired this file.

This file inspired Imagescnan.M V2.1 (Aug 2009).

MATLAB release MATLAB 7.5 (R2007b)
MATLAB Search Path
/
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
11 May 2016 Chad Greene

Chad Greene (view profile)

Brilliant! This is a well-written function with excellent documentation. It is nearly as fast as imfilter. Thanks for sharing.

05 May 2016 Vivi Andasari  
03 Feb 2015 Peter Gaube

Nice and fast, versatile and seems to work. Kudos!

12 Feb 2013 Phillip

Phillip (view profile)

Works great, wish they would implement NaN ignoring options like this in the stock Matlab filters. Good job!

05 Jun 2009 Ueli Rutishauser  
02 Sep 2008 Bill Horton

2Dimensional hamming! Incrdible!

30 Jun 2008 Fred Duncan  
25 Jun 2008 Mat Lab

This is what FEx is all about! Thanks Carlos!

Updates
27 Jun 2008

1. Fixed small bug with vector input (force F=0 in the second dimension)
2. Small changes in the description above.

04 May 2016 1.0

BSD License

Contact us