Applying a Moving average function smooth

33 ビュー (過去 30 日間)
Nikita Johnson
Nikita Johnson 2017 年 8 月 1 日
コメント済み: Xiaonan Jiang 2019 年 8 月 22 日
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.

回答 (2 件)

Swarooph
Swarooph 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.

Andrei Bobrov
Andrei Bobrov 2017 年 8 月 1 日
Let A - your data (N x 72);
out = conv2(A,ones(5,1)/5,'valid');
  1 件のコメント
Xiaonan Jiang
Xiaonan Jiang 2019 年 8 月 22 日
This is wonderful!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by