MATLAB: Find the index of the rows that have all 1

indexmatrix

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?

Best Answer

idx=find(all(A,2))