Problem selecting specific data in time series

3 次查看(过去 30 天)
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(:),:);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by