I have a cell array of more than 16700 rows and 3 column as in the example below:
'01/01/2014' '12:00:00' 'AM''01/01/2014' '06:00:00' 'AM''01/01/2014' '10:00:00' 'AM''01/01/2014' '12:00:00' 'PM''09/04/2014' '11:00:00' 'PM'
I would like to calculate the duration of two chosen dates and time (for example the last row-first raw=number of days, hours and seconds). My big problem is that I have a R2013a version of Matlab. So I can't use DateTime, I tried this:
newA = cellfun(@(s) strsplit(s, ' '), DateTime, 'UniformOutput', false); DateTimeSep = vertcat(newA{:});%%Calculs de durée et récupération de données
date=datenum(DateTimeSep(:,1),'mm/dd/yyyy');d=datestr(date(1256,1)-date(1,1), 'dd')Time=DateTimeSep(10,2)-DateTimeSep(1,2)% I didn't try to consider the AM PM problem yet....
I get d=04 (which is false) and for time I get: "Undefined function 'minus' for input arguments of type 'cell'"
Best Answer