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.
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!