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

4 次查看(过去 30 天)
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.

回答(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