Readtable() turns time stamp into decimal

I have a table with 40 columns. When I use readtable() it turns the time stamps into decimals and I don't know what the decimals mean. I need to extract the time stamps. And also I don't want the headers, but it reads them anyways.
data = readtable(filename, 'ReadVariableNames', false); %read in data file
Original excel file:
How the data looks in matlab:

5 件のコメント

Walter Roberson
Walter Roberson 2020 年 4 月 14 日
add 'headerlines', 1 to readtable
Amanda Beatty
Amanda Beatty 2020 年 4 月 15 日
Thanks @Walter Roberson! Now any idea about the time stamps? I can work with the decimals too, if I just understood what they meant.
Star Strider
Star Strider 2020 年 4 月 15 日
This appears to be a problem with Excel files that use the ‘AM/PM’ time desiignations, and still exists in R2020a. The best way to deal with it (in my experience) is to force Excel to write it as a text file to a different file name. Then, use readtable with the text file with detectImportOptions since it allows formatting options for the time columns in text files that do not exist with spreadsheet files.
Walter Roberson
Walter Roberson 2020 年 4 月 15 日
The numbers are fractions of a day, so you can
Time = days(FractionsOfADay);
Time.Format = 'hh:mm:ss';
Amanda Beatty
Amanda Beatty 2020 年 4 月 15 日
Thank you both for helping me out!
Walter, that was exactly what I was trying to do. Thanks so much!

サインインしてコメントする。

回答 (0 件)

製品

質問済み:

2020 年 4 月 14 日

コメント済み:

2020 年 4 月 15 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by