Incomplete time series: Fill missing dates with NaNs
3 views (last 30 days)
Show older comments
Hello,
I need to fill the missing dates with NaNs.
The format of the data is as follows:
month-day-year-hour-minute-second
09-01-2013-22-19-16
09-01-2013-22-34-17
09-01-2013-22-49-18
% missing data
09-02-2013-07-27-48
09-02-2013-07-42-49
09-02-2013-07-57-50
The metering interval is every 15 minutes so the number of missing data should equal to the number of 15 minute entries that are between
09-01-2013-22-49-18 and 09-02-2013-07-27-48.
Thank you.
Best,
Pavlos
0 Comments
Answers (1)
Andrei Bobrov
on 3 Jan 2016
k = datenum(['09-01-2013-22-49-18';'09-02-2013-07-27-48'],'mm-dd-yyyy-HH-MM-SS');
add = datestr(k(1):1/24/4:k(2),'mm-dd-yyyy-HH-MM-SS');
See Also
Categories
Find more on NaNs 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!