Table: Delete rows that contain only zeros
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ole Jonas Böken
le 17 Mar 2021
Commenté : Image Analyst
le 17 Mar 2021
Hi,
I am new to Matlab, but I could not find a solution after a lot of searching. I am trying to erase all rows that contains only zeros in a table (for instance row "topics 1").
I am using a table so I keep the "names" of the rows that should not be deleted for later use.
I am using Matlab Version R2020b.

The original table is attached.
Can anybody help?
Thanks in advance!
0 commentaires
Réponse acceptée
Walter Roberson
le 17 Mar 2021
mask = all(T{:,2:end}==0,2);
T(mask,:) = [];
2 commentaires
Image Analyst
le 17 Mar 2021
You can properly give thanks by Clicking the "Accept this answer" link to award the answerer "reputation points" for helping you. Thanks in advance. By the way you can also click the " 👍 Vote" icon to double the number of points awarded. 🙂
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Type Identification dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!