How to make time string from seconds of each year (total 11 years) to year (for 11 years)
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ismita
el 16 de Abr. de 2022
Comentada: Ismita
el 18 de Abr. de 2022
Dear all,
I have a time series data set from 2008 to 2019. Where 1st column is for year and 2nd column (time interval is 300 seconds =5 minutes) is for seconds of each year (i,e, for each year time starts from 0000 seconds). But I need to study for 2008 to 2019 (continuously). How can I make continuous time from January, 2008 to December, 2019 with the same interval (5 minutes) of time?
Thanks in advance.
0 comentarios
Respuesta aceptada
Voss
el 16 de Abr. de 2022
dt = datetime('2008-01-01 00:00:00'):minutes(5):datetime('2019-12-31 23:55:00');
dt(1:10).'
dt(end-9:end).'
6 comentarios
Voss
el 18 de Abr. de 2022
I think using datetime is the best way to go, yes.
You can easily add the seconds 'offset' from the beginning of each year using the seconds function
datetime('2008-01-01')+seconds(300)
datetime(2008,1,1)+seconds(300) % same
datetime(2008,1,1)+seconds(300:300:30000).'
Más respuestas (0)
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!