MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   从txt导入日期时间 (https://www.labfans.com/bbs/showthread.php?t=22285)

poster 2019-11-29 22:42

从txt导入日期时间
 
我正在尝试读取具有时间序列数据的表。

第一列以01.01.1998 00:00格式定义日期/时间。

我通过以下方式读取表格:

T = readtable('Abflussdaten.txt','DatetimeType','text'); 然后,我尝试将第一列转换为日期时间:

D = T.Datum; date = datetime(D,'InputFormat','yyyy-MM-dd HH:mm') 这给了我: [I]使用datetime时出错(第616行)无法使用格式'yyyy-MM-dd HH:mm'解析日期/时间文本[/I] 。

该表如下所示:

Datum;Q_Kempten;Q_Sonthofen 01.01.1998 00:00;27.010;9.6700 01.01.1998 01:00;26.810;9.6600 01.01.1998 02:00;26.610;9.6500 我究竟做错了什么?我认为它与日期格式有关,但这似乎是正确的。

谢谢你的帮助



[url=https://stackoverflow.com/q/59106500]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:22

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.