I have a series of dates and some corresponding values. The format of the data in Excel is "Custom" dd/mm/yyyy hh:mm.
When I try to convert this column into an array in Matlab, in order to use it as the x axis of a plot, I use:
a = datestr(xlsread('filename.xlsx',1,'A:A'), 'dd/mm/yyyy HH:MM');
But I get a Empty string: 0-by-16.
Therefore I am not able to convert it into a date array using the function datenum.
Where do I make a mistake? Edit: passing from hh:mm to HH:MM doesn't work neither. when I try only
a = xlsread('filename.xlsx',1,'A2')
I get: a = []

xlsreadthendatestr)? That will help you narrow the problem. It may be thatxlsreadis not working for whatever reason and returning an empty result. - am304HHandMMinstead.datestr(string,'dd/mm/yyyy HH:MM');- obchardonxlsreadoutputs numbers as it's first argument, so you are getting Excel serial numbers which are not the same as Matlab serial date numbers. Try either usingx2mdateif you have the finance toolbox or just adding693960i.e.dates_as_numbers = xlsread('filename.xlsx',1,'A:A') + 693960- Dan'A2'a typo on your second last line? Sure it should be'A:A'? - Dan