Home » excel » converting time from excel to matlab

converting time from excel to matlab

Posted by: admin May 14, 2020 Leave a comment


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.

How to&Answers:

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.