Mean of 1st and 2nd, 3rd and 4th, 5th and 6th elements and so on

1 view (last 30 days)
I have a 180x1 matrix. I want the mean of 1st and 2nd, 3rd and 4th, 5th and 6th elements like this. The new matrix then have 90 elements. how to do it?

Accepted Answer

Matt J
Matt J on 13 Jul 2021
mean(reshape(yourMatrix,2,[]))

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!