find the index of the rows that have all 1

9 visualizzazioni (ultimi 30 giorni)
Hi, I have a matrix
A= [ 0 0 0 0 0
0 1 1 1 1
1 1 1 0 0
0 0 0 0 1
0 0 0 1 0
1 1 1 1 1
0 1 1 1 1
0 1 1 1 0
0 0 1 1 1
1 1 1 1 1
0 0 0 1 0]
I want to find the index of the rows that have all 1, can you help me?

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 7 Apr 2016
Modificato: Azzi Abdelmalek il 7 Apr 2016
idx=find(all(A,2))

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by