Daily average of 24 hours, for a year of data
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a data sheet of 8760 hours, and another col of 8769 electrical values - and I wanted to cummulate every 24 hours to find the daily avg, thus leaving me with only 365 rows.
0 个评论
采纳的回答
Star Strider
2016-9-29
Use the reshape function.
If I understand correctly what your data are, this should do what you want:
hrs = [1:8760]'; % Create Column Vector
days = reshape(hrs, 365, []);
I assume the 8769 electrical values was an error, and you meant 8760. If that is correct, you can do the same with it as with the ‘hrs’ vector.
0 个评论
更多回答(1 个)
Steven Lord
2016-9-29
If you're using release R2016b and have your data stored in a timetable, use the retime function on your timetable. See the "Aggregate Timetable Data and Calculate Mean Values" example on the retime documentation page for more information.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!