timeseries date data matlab

1 次查看(过去 30 天)
Sarah Yun
Sarah Yun 2019-12-10
回答: dpb 2019-12-10
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

采纳的回答

dpb
dpb 2019-12-10
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
>>

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by