## Applying a Moving average function smooth

Nikita Johnson

### Nikita Johnson (view profile)

님이 질문을 제출함. 1 Aug 2017
최근 활동 Xiaonan Jiang

### Xiaonan Jiang (view profile)

님이 댓글을 추가함. 22 Aug 2019
Hello,
I have a matrix of (n*72), and due to too much noise, I have to use smooth( moving average). Moving average has to applied to each column (from 1:72) and not rows. n is no. of experiments( =5) and sensors are 72. so matrix is (5*72),so smooth has to be applied to each sensor. How should I do it? Kindly help.

로그인 to comment.

## 답변 수: 2

### Swarooph (view profile)

2017 年 8 月 1 日

You can use the movmean function and set the dim property accordingly to get the moving average. You can also look at the smoothData function which is similar but the window length is chosen heuristically.

로그인 to comment.

### Andrei Bobrov (view profile)

2017 年 8 月 1 日

Let A - your data (N x 72);
out = conv2(A,ones(5,1)/5,'valid');

Xiaonan Jiang

### Xiaonan Jiang (view profile)

on 22 Aug 2019
This is wonderful!

로그인 to comment.

Translated by