Unable to detect datetime or duration data in file for row times
22 views (last 30 days)
Show older comments
Commented: Sangani Prithvi on 25 Aug 2021
TT = readtimetable('ctm.xlsx')
I tried reading the .xlsx file, but it shows the following error
Unable to detect datetime or duration data in file 'D:\Matlab codes\ctm.xlsx'
for row times
First few rows of the spreadsheet which I used is,
Jeremy Hughes on 25 Aug 2021
This is a consequence of how Excel stores "time" data. It represents it as a "number" internally, with a custom format that makes it look like a timestamp.
MATLAB cannot tell the difference between this and any other number with a custom format.
T = readtable('ctm.xlsx');
T.Time = days(T.Time); % How Excel stores these.
T.Time.Format = "hh:mm:ss.SSS";
TT = table2timetable(T,'RowTimes','Time');
More Answers (0)
Find more on Spreadsheets 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!