Azzera filtri
Azzera filtri

timeseries date data matlab

4 visualizzazioni (ultimi 30 giorni)
Sarah Yun
Sarah Yun il 10 Dic 2019
Risposto: dpb il 10 Dic 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

Risposta accettata

dpb
dpb il 10 Dic 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
>>

Più risposte (0)

Categorie

Scopri di più su Dates and Time in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by