How to get average of interval from matrix

1 次查看(过去 30 天)
There's this data [1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,19,20....1000]
From here, [1,2,3,4], [2,3,4,5], [3,4,5,6], and [4,5,6,7] I want to go forward one by one and get the average of the interval (4 intervals).
For example, in this way [2.5, 3.5, 4.5, 5.5 ...... 998.5]
How do I make it?

采纳的回答

Matt J
Matt J 2020-10-13
编辑:Matt J 2020-10-13
conv(data,[1,1,1,1]/4,'valid')
or
movmean(data,4,'Endpoints','discard')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by