Delete zero rows from a table

조회 수: 13 (최근 30일)
Jian Teng
Jian Teng 2018년 6월 25일
댓글: Paolo 2018년 6월 26일
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!

채택된 답변

Paolo
Paolo 2018년 6월 25일
편집: Paolo 2018년 6월 26일
For a table named t:
t(~t.speed,:) = []
  댓글 수: 3
Jian Teng
Jian Teng 2018년 6월 26일
what is ~ mean?
Paolo
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 CenterFile Exchange에서 Tables에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by