Interval mean of array

조회 수: 2 (최근 30일)
Sehoon Chang
Sehoon Chang 2020년 3월 19일
답변: Rik 2020년 3월 19일
Hello Ladies and Gentlemen,
I am struggling to find a way to calculate interval mean of array.
I have X value for each 15 minutes interval for 180 days (180 x 24 x 4 = 17280 measurements).
I wish to calculate the mean in hourly interval (4320 values) and placed each hourly interval mean in the place of 15 min interval measurements.
For example)
2 1 5 2 2 6 4 6 8 3 4 6 .............
2.5 2.5 2.5 2.5 4.5 4.5 4.5 4.5 5.25 5.25 5.25 5.25 .............
Thank you

채택된 답변

Rik
Rik 2020년 3월 19일
If you ignore the meaning of the data the solution isn't too difficult.
First reshape your vector into 4 by N, then call the mean function, after which you can use repelem to expand it back to the original size.
Let me know if you need example code.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by