Effacer les filtres
Effacer les filtres

find the index of the rows that have all 1

17 vues (au cours des 30 derniers jours)
pamela sulis
pamela sulis le 7 Avr 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?

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 7 Avr 2016
Modifié(e) : Azzi Abdelmalek le 7 Avr 2016
idx=find(all(A,2))

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing 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