How do I delete a row from a matrix?

1 vue (au cours des 30 derniers jours)
Nieck Dam
Nieck Dam le 2 Juil 2017
Commenté : Star Strider le 2 Juil 2017
I have got a matrix with in the 3th column the number 1 or 0. Now I want to delete a row from a matrix when it has got a 0 in the 3th column, so the matrix will only have the number 1 in the 3th column. Can someone help me with this?

Réponse acceptée

Star Strider
Star Strider le 2 Juil 2017
If ‘M’ os your matrix, this works:
M = M(M(:,3)==1, :)
  2 commentaires
Nieck Dam
Nieck Dam le 2 Juil 2017
Thanks!
Star Strider
Star Strider le 2 Juil 2017
My pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices 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