How can i convert from table to time table
2 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Steven Lord
on 28 Jan 2019
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 Comments
More Answers (0)
See Also
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!