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.

回答(1 个)

Star Strider
Star Strider 2015-10-4
You actually mentioned it in the Tags: the find function.
  2 个评论
Star Strider
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 CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by