filling gaps in time data series with NaN
2 views (last 30 days)
Show older comments
how can I fill each missed data point of my sensor data that is logged in every 15 minutes please? I have applied interploation into the dataset so I will get 96 data points every 24 hours. Now I need these gaps to be filled in with NaN so I will get plot which displays these gaps.
0 Comments
Answers (1)
Adam Danz
on 12 Mar 2021
Compare the original vector of datetime value with the interpolated vector using ismember. This will create a logical vector identifying which values in the interpolated vector are the original data.
isOriginal = ismember(interpVector, originalVector);
interpVector(~isOriginal) = NaN;
0 Comments
See Also
Categories
Find more on Time Series 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!