array average every 30 values

3 visualizaciones (últimos 30 días)
Nikolas Spiliopoulos
Nikolas Spiliopoulos el 6 de Feb. de 2017
Comentada: Nikolas Spiliopoulos el 6 de Feb. de 2017
Hi again,
I have an Array of 1440x31 and I would like to get another Array, that's calculates the average of every 30 elements (of each row), so finally the array will be 48x31. I had a similar question but struggling to find it again,
thanks!

Respuesta aceptada

Honglei Chen
Honglei Chen el 6 de Feb. de 2017
squeeze(mean(reshape(A,30,48,31)))
Assuming A is the matrix
HTH

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by