Time weighted average after every 60mins
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
, and want to find the time weighted average after every 60 mins of the spread columnRéponses (2)
Cris LaPierre
le 27 Oct 2020
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.
0 commentaires
Peter Perkins
le 20 Nov 2020
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.
0 commentaires
Voir également
Catégories
En savoir plus sur Database Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!