Problem selecting specific data in time series

1 回表示 (過去 30 日間)
Victor Martinez
Victor Martinez 2022 年 5 月 26 日
コメント済み: Victor Martinez 2022 年 5 月 27 日
Hi everyone,
I have my data stored on a table in which the first column is a datetime vector of a whole year and the second column contains temperature measurements during this year. The problem is that the datasample is incomplete, that means that there are some days missing (no measurements) and days with only 1 measure (I need two values of temperature per day to do my calculations). I would like to know how can I select of all this data only the days and temperatures in which there are two measurements and discard those with only one.
Thanks for your time.

採用された回答

David Hill
David Hill 2022 年 5 月 26 日
d=diff(day(T.Datetime));
f=find(d==0);
F=[f;f+1];
newT=T(F(:),:);
  1 件のコメント
Victor Martinez
Victor Martinez 2022 年 5 月 27 日
Thanks David, it worked perfectly. Appreciate your help !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by