Finding row and column number of an element in a matrix given it's column representation position
1 次查看(过去 30 天)
显示 更早的评论
I have a 20x10 matrix of numbers, and I have found the column representation of the number I want, in this case it is 9, therefore, I know manually that the position in the matrix is column 1, row 9. Is there a way of Matlab telling me what matrix position it is in terms of row and column? I already know what number is in that position, but for the purposes of finding the original variables I would like to know it's position.
0 个评论
回答(1 个)
Star Strider
2015-10-4
You actually mentioned it in the Tags: the find function.
2 个评论
Star Strider
2015-10-4
That’s essentially it. You may get long vectors for ‘row’ and ‘col’, but the same rows in each will correspond to the indices of all elements that meet those criteria.
It’s always appropriate to include a tolerance as you did, to account for floating-point approximation error.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!