Syntax
[nn,nd]=VLnearestNeighborN(VL1,VL2,[N,D])
Input Parameter
VL1 : | | Point list 1 |
VL2 : | | Point list 2 |
N : | | selection of neighbors; default is [2:3] |
D : | | ''ascend' (default) or 'descend' |
Output Parameter
nn : | | rows of neigbors for VL1 in List VL2 |
nd : | | distance to neighbors from VL1 to VL2 |
Examples
PL=60*rand(10,2); VLnearestNeighborN(PL,PL,2:3); % creates Triangles
PL=60*rand(10,2); VLnearestNeighborN(PL,PL,2:4); % creates Squares
PL=60*rand(10,2); VLnearestNeighborN(PL,PL,1:size(PL,1)) % creates full mesh
PL=PLcircle(50,10); VLnearestNeighborN(PL,PL,[1],'descend') % Spokes
PL=PLcircle(50,10); VLnearestNeighborN(PL,PL,[2 3],'descend') % Spokes
PL=PLcircle(50,10); VLnearestNeighborN(PL,PL,[2 3],'descend'); FL=[[1:size(PL,1)]' ans]
Copyright 2022-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Last html export of this page out of FM database by TL: 2025-09-21