array average every 30 values

3 views (last 30 days)
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!

Accepted Answer

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

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!