Problem selecting specific data in time series

조회 수: 3 (최근 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 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