Adressing
조회 수: 3 (최근 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!