Find the elements of array with the difference between one of the remaining elements less than specified
조회 수: 1 (최근 30일)
이전 댓글 표시
Dear members of Matlab community,
I have this array (as an example):
A=[1 18 25; 26 30 11; 5 31 20]
How can I find the indices of the elements with the difference between one of the remaining elements less than 2?
In this case, it must be elements A(1,3), A(2,1), A(2,2), A(3,2). If we compare one of these elements with one of the remaining elements, the difference between them is less than 2 (25 and 26, 30 and 31, respectively).
Thank you for your help.
댓글 수: 0
채택된 답변
추가 답변 (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!