How do you get the row or column of something you need?
조회 수: 1 (최근 30일)
이전 댓글 표시
For example, if you had:
abc
def
ghi
Say I wanted the row and column of 'e', how would I do this? I have been looking everywhere for this and I just can't seem to find it. Please help. Thank you!
댓글 수: 0
채택된 답변
Image Analyst
2015년 11월 28일
[rows, columns] = find(yourMatrix == e); % e is an integer.
If e is not an integer or power of 2, see the FAQ : http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F
댓글 수: 5
Walter Roberson
2015년 11월 28일
You decide which position is the "first" one, and you index rows() and columns() at that same index. But how do you define which is the "first" ?
AB
BD
which 'B' is 'first' ?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!