Effacer les filtres
Effacer les filtres

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

4 vues (au cours des 30 derniers jours)
oran
oran le 3 Juin 2021
Commenté : oran le 4 Juin 2021
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 commentaires
KSSV
KSSV le 4 Juin 2021
Have a look on functions knnsearch and rangesearch.
oran
oran le 4 Juin 2021
@kssv - thanks. Rangeseach is close enough to what I needed. That plus a horrific logic loop has gotten me where I need.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by