Azzera filtri
Azzera filtri

Finding the row/column locations of 1s in a boolean matrix

5 visualizzazioni (ultimi 30 giorni)
I have a Boolean matrix and I would like to find the row/column locations of all of the ones within the matrix. How might I go about doing this?

Risposta accettata

Matt Fig
Matt Fig il 24 Nov 2012
Modificato: Matt Fig il 24 Nov 2012
A = rand(3)>.5;
[I,J] = find(A) % I is the rows, J is the cols.

Più risposte (0)

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by