Question: My goal is to write a MATLAB code that generates a nearest - neighbor map / table of N points listed in provided file xyz

My goal is to write a MATLAB code that generates a nearest-neighbor map/table of N points listed in provided filexyz300.txt. Assume that the nearest neighbor(s) of a point lies within a radial distance of 2.8 units. We are given: maximum radial distance r=2.8, N=number of points=300, and L=17.86, where L is the length, height, and width of a cubic boundary box. I know that I have the right general concept in my code, but I am not implementing the boundary box correctly. (See image showing my code).My results should show that no index has more than 4 Nearest Neighbors (not worried about 2nd-NN or 3rd-NN or kth-NN yet), but instead I am getting that every index has 978 NNs. I need help implementing boundary and fixing this. Please test results to make sure 4 is the greatest. I am confused greatly beyond this point, so expalantion is greatly appreciated. Someone mentioned implementing only the upper-triangle of the matrix?? Also, we do not want to back track maybe meaning not to repeat idk?? We insist that NNs are reversible, if i is NN of j, then j is NN of i. Also my notes say "if portion of the radius around the current point is outside of the box, map changes to accomodate the box" Please help me understand and correct my mistake. I have attached my code, and you can see the results. Please help me fix this code to get appropriate results. Thank you in advace.
 My goal is to write a MATLAB code that generates a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!