Calculate Running average of large data set

27 ビュー (過去 30 日間)
Benjamin Cowen
Benjamin Cowen 2018 年 8 月 14 日
回答済み: Naman Chaturvedi 2018 年 8 月 17 日
I have a data structure. I can plot the time vs. temp using this command:
scatter(getcolumn(C{1, 1}(:,[1,6]),1), getcolumn(C{1, 1}(:,[1,6]),2))
The problem is I have so much data, there is a lot of noise. How can I plot the a moving average which uses X amount of points before the current point (and including the current point)

採用された回答

Naman Chaturvedi
Naman Chaturvedi 2018 年 8 月 17 日
Hello Benjamin,
You can use the movmean function to calculate the moving average of the data as follows:
>> M = movmean(A,[kb kf]) %computes the mean with a window of length kb+kf+1 that includes the element in the current position, kb elements backward, and kf elements forward.
Hope this helps.

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by