Delete zero rows from a table

32 次查看(过去 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!

采纳的回答

Paolo
Paolo 2018-6-25
编辑:Paolo 2018-6-26
For a table named t:
t(~t.speed,:) = []
  3 个评论
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 中查找有关 Structures 的更多信息

标签

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by