datum= '01.06.2014' '02.06.2014' '03.06.2014' '04.06.2014' '05.06.2014'
I want to convert them to a Matlab recognised date array, so that I can ultimately determine in which Calender Week they fall in (using the function week)
My code looks like this:
%reading in the data file and isolating the weekday column
dateiname='ABGERUFENE_SRL_BETR_IST-WERTE_20140601_20140630_Netzregelverbund_20150408-225302.CSV'; [num text raw]=xlsread(dateiname); raw([1 2 3 4 5],:) = []; datum=raw(:,1)%conversion into date
datum=datetime(datum, 'InputFormat','dd.mm.yyyy');
However this returns the error message: ??? Undefined function or method 'datetime' for input arguments of type 'cell'. It should be able to handle a string, so I don't understand the problem. I have used the query
iscellstr(datum)
which returns a 1, so I really don't know why the error appears. I have also tried using the "text" data – that doesn't work either.
Any help troubleshooting will be much appreciated!!!!!
Best Answer