storing indices of some entries in a matrix

1 次查看(过去 30 天)
I want to store the index of all the entries with value 5 in a matrix. is there an inbuilt function for it.

回答(1 个)

Mischa Kim
Mischa Kim 2014-4-20
编辑:Mischa Kim 2014-4-20
Ryan, use
[r c] = find(data==5)
r and c are the row and column indices of all data entries equal to 5.

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by