Check for missing dates in date array in Matlab -
i have array of, say, end of month datenum
in matlab. looking function check if dates consecutive. consider following array of dates:
dates = [datenum(2000,1:10,eomday(2000,1:10)),datenum(2000,12,31),datenum(2001,1:2,eomday(2001,1:2))]; datestr(dates) ans = 31-jan-2000 29-feb-2000 31-mar-2000 30-apr-2000 31-may-2000 30-jun-2000 31-jul-2000 31-aug-2000 30-sep-2000 31-oct-2000 31-dec-2000 31-jan-2001 28-feb-2001
where 30-nov-2000 missing. functionality identify 31-jan-2000 31-oct-2000 consecutive, 30-nov-2000 missing, , 31-dec-2000 28-feb-2001 consecutive.
any ideas??
you can convert dates serial numbers using datenum
, can diff
on , find
values greater datenum of desired interval.
Comments
Post a Comment