Delete zero rows from a table
조회 수: 13 (최근 30일)
이전 댓글 표시
I have a table in MatLAB. The table has two column, one is called direction, another one is call speed. There are many zeros in the speed column. I would like to delete the row that has 0 in speed. Could anyone help me with that? Thanks!
댓글 수: 0
채택된 답변
Paolo
2018년 6월 25일
편집: Paolo
2018년 6월 26일
For a table named t:
t(~t.speed,:) = []
댓글 수: 3
Paolo
2018년 6월 26일
Tilde is the logical NOT operator. ~t.speed is used to find all the rows where t.speed is equal to zero. You can find more information on logical operators in the documentation (link).
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!