필터 지우기
필터 지우기

How can I delete certain rows from a datetime array?

조회 수: 4 (최근 30일)
Ann St
Ann St 2020년 9월 14일
답변: Ann St 2020년 9월 14일
I have a matrix of numbers where each column corresponds to a measurement performed over time. I also have a "datetime" array that corresponds to each matrix row (the datetime of a measurement).
My problem is that I need to delete certain rows from the matrix and also delete the same rows from the datetime array. I have the indices of the rows I need to delete:
removeRowIdx7 = any(isnan(timeMeasurements),2)
But how can I now use them to delete rows from the datetime array? The datetime format is: '2017-12-30 23:00:00'. Thank you.

채택된 답변

Ann St
Ann St 2020년 9월 14일
I figured it out! I will leave the anwer here for any other newbies who have the same problem. "DT" is my datetime array.
DT(removeRowIdx7) = [];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by