Get and interpolate missed daily data
Show older comments
Hi all,
I am working with daily climate data for future projections on a basin catchment (see file attached). I just noticed that the daily precipitation data are reported considering all months of 30 days. So, I need to add rows for month of 31 days (January, March, May, July, August, October,December) and delete row for the month of February (in this case also considering the 29 days for 2032, 2036, 2040, 2044, 2048, 2052, 2056, 2060). Is there any way to automatize the process?
Also how can I interpolate the missing data?
Thanks
Accepted Answer
More Answers (1)
Arif Hoq
on 14 Mar 2022
A=(datetime(2030,1,1):datetime(2060,12,31))'; % generating normal date
A1=datenum(A);
C=readtable('missed data.xlsx');
D1=datenum(table2cell(C(:,1)));
E=ismember(A1,D1);
idx=find(E==0); % index of missing date
F=datetime(A1(idx),'ConvertFrom','datenum') % missing date
2 Comments
Peter Perkins
on 14 Mar 2022
Edited: Peter Perkins
on 14 Mar 2022
DON'T use datenum. It has been old for many years. Can't say this strongly enough. Use datetime.

Stefania Avvedimento
on 14 Mar 2022
Categories
Find more on Calendar in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!