how to read mixed date and data
古いコメントを表示
How to read this data file:
2020/11/15 07:30:55 27.50 124
2020/11/15 07:40:55 27.63 114
2020/11/15 07:50:55 27.71 95
採用された回答
その他の回答 (1 件)
the cyclist
2021 年 9 月 24 日
0 投票
You can specify the input formating if needed.
4 件のコメント
DwiNY
2021 年 9 月 25 日
the cyclist
2021 年 9 月 25 日
NaT means "Not-aTime", and you will typically get this error if some of the times are a different format from what you have specified.
Can you upload the data, or a small sample that has some rows that worked, and some rows that gave NaT?
DwiNY
2021 年 9 月 27 日
Jeremy Hughes
2021 年 9 月 27 日
If you're using format, there are issues with your format in both cases: mm cannot be both months and minutes, you want MM.
Also, you probably want the second part as duration if you're parsing these as separate fields.
try this: formatSpec = '%{yyyy/MM/dd}D{hh:mm:ss}T%f%f'
But I like your first approach better:
delimiter = '\t'; %no space
formatSpec = '%{yyyy/MM/dd HH:mm:ss}D%f%f'
カテゴリ
ヘルプ センター および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!