matrix
显示 更早的评论
if i want to find the index of certain value in 2D matrix, how can I find that? e.g: I have a 300x300 matrix. There is a value 90096 in that matriz. I want to find its index. Please show me the code.
采纳的回答
更多回答(2 个)
Jim
2011-12-20
0 个投票
you can use find command to know the index of values in matrix
C.J. Harris
2011-12-20
Using find with two return parameters might make it easier.
[row, col] = find(matrix == 90096);
3 个评论
Khawaja Asim
2011-12-20
Walter Roberson
2011-12-20
Probably the value in the matrix was not _exactly_ 90096
http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F
Khawaja Asim
2011-12-20
类别
在 帮助中心 和 File Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!