Find the max value in a kernal
조회 수: 2 (최근 30일)
이전 댓글 표시
I need to iterate over a 2d array finding the maximum value inside a given kernel. However, the kernel is custom, not square.
댓글 수: 0
답변 (1개)
Roger Stafford
2018년 3월 8일
편집: Roger Stafford
2018년 3월 8일
Let M be your matrix. Let R be a vector of the matrix's row subscripts of your kernel, and let C be a vector of corresponding column subscripts of the kernel. Then do:
mx = max(M(sub2ind(size(M),R,C))); % mx is maximum of M in kernel
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!