Delete rows from a table using a condition on datetimes
이전 댓글 표시
Hello!
I'm working with a table T having two separate datetime columns containing dates ('M\d\yyyy'): let' say the first column is called dates1 and the second is called dates2. I want to find a way to keep ONLY the rows where the column dates2 is one day ahead of column dates1.
Can something like this work? I'm dealing with a huge set of data and I don't want to make mistakes
indexes=(T.dates1+1)~=T.dates2; %Positions to delete
T(indexes,:)=[]; %delete all the columns in those positions
Hope that the question is clear.
Thank you!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!