필터 지우기
필터 지우기

Finding directional nearest neighbors (N, E, S, W) for x/y data stored in struct arrays

조회 수: 4 (최근 30일)
oran
oran 2021년 6월 3일
댓글: oran 2021년 6월 4일
I am evaluating locations of foundations for solar racking for large sites. The way this data comes to me is in "blocks." For each block, I get some key information and then calculate the locations of all foundations within this block. The initial and calculated information is segregated into structs for each block. All the data is initially calculated on a per column (matrix) basis, and then each variable, x, y, z location is reshaped into a single column array for spreadsheet output.
The foundation location x's (eastings) and y's (northings) are not necessarily rectilinear. For a given row, all X's will be held constant, but when comparing one row's y's with anothers there will be slight variance.
What I am looking to do is to locate the four cardinal nearest neighbors of each interior foundation. I feel like dsearchn or a similar function should be easily manipulated to give me what I am looking for, but for the life of me I cannot figure it out.
Does anybody have any ideas on how this can be achieved within the above described structure? I am relatively new to matlab, but so far it's been very intuitive. I've included a screen grab of the foundation locations (colored by struct) here. Any help would be greatly appreciated.
  댓글 수: 2
KSSV
KSSV 2021년 6월 4일
Have a look on functions knnsearch and rangesearch.
oran
oran 2021년 6월 4일
@kssv - thanks. Rangeseach is close enough to what I needed. That plus a horrific logic loop has gotten me where I need.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by