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!