removing rows from matrix which equal particular number

1 vue (au cours des 30 derniers jours)
sermet
sermet le 26 Juil 2018
A=[1 2 3;4 5 6;99 7 8;5 5 99;1 2 3;99 99 5];
How can I remove rows include 99 as follows;
B=[1 2 3;4 5 6;1 2 3];
The actual matrix is much more, the above is just an example.

Réponse acceptée

Adam Danz
Adam Danz le 26 Juil 2018
The first line identifies rows of A that have 99. The second line removes those rows.
removeIdx = any(A == 99, 2);
A(removeIdx,:) = []

Plus de réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox 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!

Translated by