Importing Excel Data with Custom Data Format [hh]:mm:ss.00
3 views (last 30 days)
Show older comments
My excel data contains a Custom format which includes milliseconds. It looks as follows: [hh]:mm:ss.00
How do I import this data using xlsread?
0 Comments
Answers (3)
Fangjun Jiang
on 10 Aug 2011
use [Num, Txt, Raw]=xlsread() to read the data. Use the data in Raw which is suppose to be the raw format. Then use the MATLAB function datenum() to process it.
Raw={'[12]:23:45.023','[13]:34:34.230'}
t=datenum(Raw,'[HH]:MM:SS.FFF')
0 Comments
bym
on 10 Aug 2011
dt = xlsread('testdate.xls'); %sample ->978378:58:10.340
mdates = datenum('30-Dec-1899')+dt;
datestr(mdates,'dd-mm-yy HH:MM:SS.FFF')
0 Comments
George
on 11 Aug 2011
4 Comments
Fangjun Jiang
on 16 Aug 2011
@proecsm, I guess he was not expecting the automatic conversion when using xlsread(), and also not expecting the smart formatting of Excel.
bym
on 16 Aug 2011
@Fangjun, maybe not, but it seems the urgency of finding a solution has gone away...
See Also
Categories
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!