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일

1 개 추천

For a table named t:
t(~t.speed,:) = []

댓글 수: 3

Jian Teng
Jian Teng 2018년 6월 26일
Thank you so much!
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개)

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

제품

릴리스

R2018a

태그

질문:

2018년 6월 25일

댓글:

2018년 6월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by