converting dates in textfile
古いコメントを表示
Hello,
I am having problems trying to covert the dates from the first column on a textfile, called A
1880
1880.08340000000
1880.16660000000
1880.25000000000
1880.33340000000
1880.41660000000
1880.50000000000
1880.58340000000
1880.66660000000
1880.75000000000
1880.83340000000
1880.91660000000
Date = datenum(A{:,1});
Date = datetime(Date,'ConvertFrom','datenum');
The output gives:
'22-Feb-0005 00:00:00'
'22-Feb-0005 02:00:05'
'22-Feb-0005 03:59:54'
'22-Feb-0005 06:00:00'
'22-Feb-0005 08:00:05'
'22-Feb-0005 09:59:54'
'22-Feb-0005 12:00:00'
'22-Feb-0005 14:00:05'
'22-Feb-0005 15:59:54'
'22-Feb-0005 18:00:00'
This is obviously incorrect.
The dates in the raw textfile look like this:

Maybe I need to round the column to X number of decimal places BEFORE using the datenum function?
If so, how should I do this?
Thank you.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!