Delete zero rows from a table
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Paolo
am 25 Jun. 2018
Bearbeitet: Paolo
am 26 Jun. 2018
For a table named t:
t(~t.speed,:) = []
3 Kommentare
Paolo
am 26 Jun. 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).
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Tables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!