How can I correct for gaps in an supposedly evenly spaced array

3 ビュー (過去 30 日間)
dormant
dormant 2020 年 7 月 23 日
回答済み: Walter Roberson 2020 年 7 月 27 日
I have two one-dimensional arrays, data and datim, the latter containing date values. These are large arrays containing a days worth of data sampled at 100 or 200 samples per second.
The date values are meant to be evenly spaced and sequential, but sometimes there are gaps. The gaps can be anywhere, including at the beginning or end of the day.
(I know that this is a very, very bad way to store time-series data, but I didn't write the function that reads the source data file).
I need to recreate the two arrays, without any gaps.
All the ways I can think of doing this involve loops and take a long time to execute.
Is there a better way?

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 7 月 27 日
Convert to timetable() and retime() and convert back to time series.

カテゴリ

Help Center および File ExchangeTime Series Events についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by