COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Moving average to smooth 2D data

• Email
• Follow

```hi, all
I just went through the help for Moving Average filtering. Based on my understanding, the algorithm only can be used to smooth (1 Dimensional ) one column or one row of values. as shown in the equation.
ys(i)=(y(i+N)+y(i+N-1)+...+y(i-N))/(2N+1)
as presented here:
http://www.mathworks.com/help/toolbox/curvefit/bq_6yqb.html
but the figure (a, b, c, d) for moving average filtering looks like that it smooths every point in x and y.

I hope my question is made clearly .

thanks
```
 0

See related articles to this posting

```"zheng " <fiendniu2003@hotmail.com> wrote in message <ih7eoj\$66c\$1@fred.mathworks.com>...
> hi, all
> I just went through the help for Moving Average filtering. Based on my understanding, the algorithm only can be used to smooth (1 Dimensional ) one column or one row of values. as shown in the equation.
> ys(i)=(y(i+N)+y(i+N-1)+...+y(i-N))/(2N+1)
> as presented here:
> http://www.mathworks.com/help/toolbox/curvefit/bq_6yqb.html
> but the figure (a, b, c, d) for moving average filtering looks like that it smooths every point in x and y.
>
> I hope my question is made clearly .
>
> thanks

conv2(your_image,ones(3)./9,'same');

Will calculate the average of your_image and 8-connected neighbors. Extend it as you need.
```
 1

```Sean de

my purpose is to use moving average to smooth a group of points which each point has x and y.
that is why I want to know does the moving average in curve fitting toolbox can implement this?
```
 0