Azzera filtri
Azzera filtri

How to determine the surrounding vertices of a particular node/voronoi cell ?

1 visualizzazione (ultimi 30 giorni)
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')

Risposte (0)

Categorie

Scopri di più su Voronoi Diagram in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by