Index timetable variables and remove rows based on criteria.

조회 수: 7 (최근 30일)
Eric Escoto
Eric Escoto 2021년 10월 12일
댓글: Eric Escoto 2021년 10월 12일
I'm trying to remove rows of a timetable based on if any cell is greater than or equal to 8.
My line is below, can't see what the issue is with my indexing.
TT(TT{:,2:2001} >= 8, :) = [] % Remove rows with values greater than or equal to 8.0.
I only want to include columns 2:2001, but apply the indexing to all times (rows) in my data.
Thanks.

채택된 답변

Walter Roberson
Walter Roberson 2021년 10월 12일
TT(any(TT{:,2:2001} >= 8,2), :) = [];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by