Find index to x,y pairs
조회 수: 4 (최근 30일)
이전 댓글 표시
I have two vectors xEdges and yEdges which define positions in the x,y plane. In the example below, the lower left location value would be (20, 2). Given a vector list of locations, how can I find their indices within xEdges,yEdges? In the example below, the indices corresponding to the desired locations xFind,yFind would be ix = [ 2 4 4 6 ], iy = [ 2 6 8 9 ]. I need to use the indices to look up values of a matrix which has size nY,nX.
xEdges = 2:11 ; yEdges = 20:28 ; % Location vector
xFind = [ 3 5 5 7 ] ; yFind = [ 21 25 27 28 ] ; % x, y pairs
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!