Effacer les filtres
Effacer les filtres

delete matrix row with certain value

1 vue (au cours des 30 derniers jours)
Patrick
Patrick le 11 Nov 2014
Commenté : Patrick le 11 Nov 2014
how can i remove the rows with a certain number say, 2?

Réponse acceptée

the cyclist
the cyclist le 11 Nov 2014
M = magic(3);
M(any(M==2,2),:) = []
  1 commentaire
Patrick
Patrick le 11 Nov 2014
Thanks pal.

Connectez-vous pour commenter.

Plus de réponses (1)

Adam
Adam le 11 Nov 2014
A = [2 3 4 5; 6 7 8 9; 2 1 1 1; 3 3 3 3];
A( any(A == 2, 2 ),: ) = [];

Catégories

En savoir plus sur Data Import and Network Parameters dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by