SmoothArea

Two dimensional averaging (mean or median) of an array using a sliding window.
16 Downloads
Updated 1 Jul 2022

View License

This function performs a two dimensional smoothing on a given array by calculating the median or mean value around each entry within a sliding window.
The size and center point of the sliding window can be chosen as wanted. The window adapts to the borders of the array. You can choose whether or not the center point itself should be considered in the averaging process.
NaN values in the original data may be kept or replaced with averaged data from surrounding entries. You are free to choose if they should be considered in the averaging or not.
Further control about the process may be achieved by using binary maps marking locations of:
  • only certain values that shall be replaced with a new value
  • values to not be considered in the averaging (useful to handle outliers in the data)
This is my first published piece of code. If you experience issues or have tips for improvement please let me know.

Cite As

Simon Schwab (2024). SmoothArea (https://www.mathworks.com/matlabcentral/fileexchange/110135-smootharea), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.3

bugfix in exclude map function

1.0.2

changes in description

1.0.1

changed description

1.0.0