find the index of the rows that have all 1

15 Ansichten (letzte 30 Tage)
pamela sulis
pamela sulis am 7 Apr. 2016
Bearbeitet: Azzi Abdelmalek am 7 Apr. 2016
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?

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 7 Apr. 2016
Bearbeitet: Azzi Abdelmalek am 7 Apr. 2016
idx=find(all(A,2))

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by