How can i convert from table to time table
2 次查看(过去 30 天)
显示 更早的评论
Hi
Please, am new to matlab.
I would like to convert an imported table to time table but i'm having difficulties.
T = table2timetable(T)
Error using table2timetable (line 58)
Input table must contain datetime or duration vector for row times.
Attached is a picture of the data.
Thanks
0 个评论
采纳的回答
Steven Lord
2019-1-28
Your sampTime variable looks like it contains the times stored as text data, not as a datetime array. Create a variable (either inside your table or as an independent variable) that stores the dates as a datetime array (pass the text into datetime) then call table2timetable. If you created the datetime variable in the table itself, table2timetable will use that for the RowTimes. If not you will need to pass the datetime array in as well.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!