Borrar filtros
Borrar filtros

Delete zero rows from a table

40 visualizaciones (últimos 30 días)
Jian Teng
Jian Teng el 25 de Jun. de 2018
Comentada: Paolo el 26 de Jun. de 2018
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!

Respuesta aceptada

Paolo
Paolo el 25 de Jun. de 2018
Editada: Paolo el 26 de Jun. de 2018
For a table named t:
t(~t.speed,:) = []
  3 comentarios
Jian Teng
Jian Teng el 26 de Jun. de 2018
what is ~ mean?
Paolo
Paolo el 26 de Jun. de 2018
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).

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by