Time weighted average after every 60mins

please i have a sample data as in the picture, and want to find the time weighted average after every 60 mins of the spread column

댓글 수: 1

Rik
Rik 2020년 10월 27일
Sounds like a nice project. Do you have a question?
Have a read here and here. It will greatly improve your chances of getting an answer.

댓글을 달려면 로그인하십시오.

답변 (2개)

Cris LaPierre
Cris LaPierre 2020년 10월 27일

0 개 추천

Look into groupsummary. You'll probably want something like this. I'm assuming your data is in a table.
groupsummary(tblName,Date.time,'hour','mean',spread)
I wouldn't call this a weighted average, though. You'll need to provide more details about how you want to time-weight the average.
Peter Perkins
Peter Perkins 2020년 11월 20일

0 개 추천

Or put the data in a timetable and use retime(tt,'hourly','mean'). If you need weights, you can write your own aggregation function for hourly aggregation.

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

질문:

2020년 10월 27일

답변:

2020년 11월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by