Finding indices of certain values

2 vues (au cours des 30 derniers jours)
Anurag Gupta
Anurag Gupta le 1 Nov 2020
Commenté : Anurag Gupta le 1 Nov 2020
I have a matrix A=[ 1 2; 4 5; 0 0; 7 8;0 0]
i want to find the row number wherein both the coloumns are 0 0
i tried [ r,~] =find(A==[0 0])
but it returns me 3 5 3 5 whereas the output for me should be just 3 5
it would be great if you can spare some time and help me out with this.

Réponse acceptée

madhan ravi
madhan ravi le 1 Nov 2020
find(all(A == 0, 2))
  1 commentaire
Anurag Gupta
Anurag Gupta le 1 Nov 2020
Sorry mate if the tag irritates you. anyways thanks for answering.

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by