timeseries date data matlab

3 visualizaciones (últimos 30 días)
Sarah Yun
Sarah Yun el 10 de Dic. de 2019
Respondida: dpb el 10 de Dic. de 2019
Hi,
I have a textfile for date (years from 1990 to 2015) and temp.
The dates in the date column are given in the following format:
727168
727199
727230
727258
727289
727319
727350
Why are the dates written like this and how can I convert them to standard dates in terms of days, months and years (if applicable)?
Thanks

Respuesta aceptada

dpb
dpb el 10 de Dic. de 2019
Either however you created the text file and/or imported it, you ended up with the datenum integer portion of the date/time information (presuming there was time also originally). We'd have to know the rest of the process to be able to help regarding avoiding that.
But, given where you are, just convert the datenum to datetime via
>> t=[727168
727199
727230
727258
727289
727319
727350];
>> datetime(t,'ConvertFrom','datenum')
ans =
7×1 datetime array
01-Dec-1990 00:00:00
01-Jan-1991 00:00:00
01-Feb-1991 00:00:00
01-Mar-1991 00:00:00
01-Apr-1991 00:00:00
01-May-1991 00:00:00
01-Jun-1991 00:00:00
>>

Más respuestas (0)

Categorías

Más información sobre Dates and Time 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