Filter löschen
Filter löschen

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

4 Ansichten (letzte 30 Tage)
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 Kommentare
KSSV
KSSV am 4 Jun. 2021
Have a look on functions knnsearch and rangesearch.
oran
oran am 4 Jun. 2021
@kssv - thanks. Rangeseach is close enough to what I needed. That plus a horrific logic loop has gotten me where I need.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by