Find neighboring values of a target value in array
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everybody,
I have a matrix, whose values represent the points of geometry-changes of a specific 3D geometry (mainly sorts of angularly aligned cuboids) in intervals. What I want to do is: enter a height, in which the geometry is analyzed. Afterwards, the 2D geometry in the user defined height is processed.
With my knowledge, I would achieve the solution with a combination of for-loop (heigth-direction entities of the matrix) and some if-conditions, but I am sure, there exists a more elegant solution for my problem.
Is there any function, which finds the two height-value neighbors in the matrix entities? Then, the interpolation part is not a problem any more.
Can anyone help me? Thanks in advance!
Best wishes, Georg
댓글 수: 0
답변 (1개)
Walter Roberson
2016년 9월 13일
Depending on how your values are represented, slice() might be what you need.
댓글 수: 2
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!