Split timetable using retime

1 visualización (últimos 30 días)
Jonas Cervelim
Jonas Cervelim el 30 de Mayo de 2019
Respondida: Peter Perkins el 4 de Jun. de 2019
Hi!
I have many .csv files with different datetime informations. I need to split them into 4 diary periods, which means that I should take a mean of data acquired in same daytime but in different days.
I am trying to use retime function to execute this job, but it's not working to aggregate different days in the timetable.
Here is the code I am using:
newTimes1 = [datetime('28/05/2019 00:00:00'):minutes(5):datetime('28/05/2019 05:59:59')];
newTimes2 = [datetime('28/05/2019 06:00:00'):minutes(5):datetime('28/05/2019 11:59:59')];
newTimes3 = [datetime('28/05/2019 12:00:00'):minutes(5):datetime('28/05/2019 17:59:59')];
newTimes4 = [datetime('28/05/2019 18:00:00'):minutes(5):datetime('28/05/2019 23:59:59')];
T1 = retime(TT,newTimes1,'mean')
T2 = retime(TT,newTimes2,'mean')
T3 = retime(TT,newTimes3,'mean')
T4 = retime(TT,newTimes4,'mean')
Is there a way to concatenate this data only by time, not date?
Is there a way to write datetime only for time, not day?
OR
Am I using the best alternative to execute this chore?

Respuestas (1)

Peter Perkins
Peter Perkins el 4 de Jun. de 2019
You are using datetimes, which is a linear time line. It sounds like you want "time of day", which is a circular time line. I can't really tell exactly what you need, but a first guess is to use the timeofday function on the time vectors of all your timetables.
Except that in your example, you onl;y show one day. It's possible that you just want to change the display format of the datetimes to not show the date? A simple clear concrete example would help.

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by