filling gaps in time data series with NaN

조회 수: 1 (최근 30일)
Soso
Soso 2021년 3월 12일
답변: Adam Danz 2021년 3월 12일
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.

답변 (1개)

Adam Danz
Adam Danz 2021년 3월 12일
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;

카테고리

Help CenterFile Exchange에서 NaNs에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by