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

5 次查看(过去 30 天)
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?

采纳的回答

Matt Fig
Matt Fig 2012-11-24
编辑:Matt Fig 2012-11-24
A = rand(3)>.5;
[I,J] = find(A) % I is the rows, J is the cols.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by