how to do running mean?
8 次查看(过去 30 天)
显示 更早的评论
Hi all,
I have a 3d matrix with a dimension of 21*41*273, for which I want to do the running mean over the third dimension (273 days) for every 4 days.
Any help would be appreciated.
0 个评论
采纳的回答
Ameer Hamza
2020-10-22
Try something like this
M = rand(21, 41, 273);
M_new = movmean(M, [0 3], 3, 'Endpoints', 'discard');
M_new = M_new(:,:,1:4:end);
5 个评论
Ameer Hamza
2020-10-25
Yes, It means that it takes data from the current value and the next three values.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!