1
votes

I'm trying to import data from excel into matlab where the data contains a column of time where time is in the format of 00:05, 22:00 etc...

Is there a way of importing this into matlab without changing the format?

Currently, when importing the vector into matlab, it changes the values to decimals which is not what I need.

1
Note that 00:05 and 22:00 are not storage formats; these are display formats only. The storage format is the same as for numerical data: IEEE double-precision floating point. That's why you're getting decimal data out the other end. That may help you understand yuk's answer a little better. - phoog

1 Answers

3
votes

Have you tried to convert the numbers you've got from Excel file with DATESTR function?

xtimestr = datestr(xtime,'HH:MM');

This should have no problems with time. But you have to take care if you are getting dates as well, because of different date systems used by MATLAB and Excel. See When to Convert Dates from Excel Files for more details.