how to do running mean?

3 visualizaciones (últimos 30 días)
Lilya
Lilya el 22 de Oct. de 2020
Comentada: Lilya el 25 de Oct. de 2020
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.

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 22 de Oct. de 2020
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 comentarios
Ameer Hamza
Ameer Hamza el 25 de Oct. de 2020
Yes, It means that it takes data from the current value and the next three values.
Lilya
Lilya el 25 de Oct. de 2020
Thank you!

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by