How to determine the surrounding vertices of a particular node/voronoi cell ?
1 次查看(过去 30 天)
显示 更早的评论
I want to determine the surrounding(corresponding) vertices of all the nodes of the voronoi cells. Please help adding to the program below. x=[2 2 3 3 4 5 5 5 6 7 8]; y=[1 3 1 3 4 4 5 6 5 4 2]; N=[x' y']; axis([0 10 0 10]); hold on; scatter(x,y, [], 'filled'); %Labelling the nodes labels = cellstr( num2str([1:length(x)]') ); plot(N(:,1), N(:,2), 'bx') text(N(:,1), N(:,2), labels, 'VerticalAlignment','bottom', ... 'HorizontalAlignment','right') %Voronoi voronoi(x,y,'green'); [vx,vy]=voronoi(x,y); plot(vx,vy,'rx'); grid on [V C]=voronoin(N); % %Labelling the vertices labels = cellstr( num2str([1:length(V)]') ); plot(V(:,1), V(:,2), 'rx') text(V(:,1), V(:,2), labels, 'VerticalAlignment','bottom', ... 'HorizontalAlignment','right')
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Voronoi Diagram 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!