MATLAB: Excel Date Format to Matlab Number Array

excelimporting excel data

I have excel data, of which one column is in excel date format of the type '02/12/2013'. When I use xlsread, matlab gives me a number. I need to get matlab to give me an array. For instance, if 2 cells contain '02/03/2013' and '02/04/2013', I want matlab to give me an array of the following type, [02,02;03,04;2013,2013]. Anyone out there know how to do that? Thanks in advance.

Best Answer

Have you tried using datevec?
Take one of the cells as an example ... '02/03/2013'.
>> datevec('02/03/2013','mm/dd/yyyy')
ans =
2013 2 3 0 0 0