Adressing
1 次查看(过去 30 天)
显示 更早的评论
Hello, If i have:
A=[1 2 3 ;7 5 3;9 8 3;11 53 45]
A =
1 2 3
7 5 3
9 8 3
11 53 45
and i do
>> A(9)
ans =
3
How can i know the row and coloumn through its index value ???
Thanks
0 个评论
采纳的回答
Fangjun Jiang
2011-9-27
help sub2ind
help ind2sub
[row,col]=ind2sub(size(A),9)
I guess you mean this:
A=[1 2 3 ;7 5 3;9 8 3;11 53 45];
[Row,Col]=find(A==9)
3 个评论
Fangjun Jiang
2011-9-27
What do you mean? You can't run this?
A=magic(3);[row,col]=ind2sub(size(A),9)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!