Daily average of 24 hours, for a year of data
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Tushar Agarwal
el 29 de Sept. de 2016
Respondida: Steven Lord
el 29 de Sept. de 2016
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 comentarios
Respuesta aceptada
Star Strider
el 29 de Sept. de 2016
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 comentarios
Más respuestas (1)
Steven Lord
el 29 de Sept. de 2016
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 comentarios
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!