Filter löschen
Filter löschen

timeseries date data matlab

4 Ansichten (letzte 30 Tage)
Sarah Yun
Sarah Yun am 10 Dez. 2019
Beantwortet: dpb am 10 Dez. 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

Akzeptierte Antwort

dpb
dpb am 10 Dez. 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
>>

Weitere Antworten (0)

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by