pick column and row of an entry
2 次查看(过去 30 天)
显示 更早的评论
Hi, i would like to know is there any function which allow me to pick matrix entries greater than 10 and print those entries rows and columns in cells or in 2 separate matrices?
0 个评论
采纳的回答
Wayne King
2013-3-4
编辑:Wayne King
2013-3-4
X = randi(20,10);
[I,J] = ind2sub(size(X),find(X>10));
The I vector has the row indices, the J vector has the column indices. You can certainly store those indices however you like.
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!