Effacer les filtres
Effacer les filtres

[v c]=voronoin(). Here i have to know about the output files of v and c.

6 vues (au cours des 30 derniers jours)
Sankarganesh P
Sankarganesh P le 17 Oct 2022
Commenté : KSSV le 17 Oct 2022
clc
clear all
P = [0.5 0; 0 0.5; -0.5 -0.5; -0.2 -0.1; -0.1 0.1; 0.1 -0.1; 0.1 0.1] ;
[v c]=voronoin(P);
%Here i have to know about the output files of v and c.
%V-voronoi vertices and C-Voronoi cells
%output of c ( what these points are denotes)
%[9,2,1,8]
%[8,1,6,5,7]
%[6,1,2,4]
%[6,4,3,5]
%[10,3,5,7]
%[10,3,4,2,9]
%[10,7,8,9]

Réponse acceptée

KSSV
KSSV le 17 Oct 2022
Modifié(e) : KSSV le 17 Oct 2022
v denotes the points/ coordinates of the voronoi edges and c gives you the nodal connectivity. The array c has the indices of the vertices v for which the elements are connected.
clear all
P = [0.5 0; 0 0.5; -0.5 -0.5; -0.2 -0.1; -0.1 0.1; 0.1 -0.1; 0.1 0.1] ;
[v, c]=voronoin(P);
voronoi(P(:,1),P(:,2))
hold on
plot(v(:,1),v(:,2),'+k')
figure
hold on
for i = 1:length(c)
x = v(c{i},1) ;
y = v(c{i},2) ;
patch(x,y,rand(1,3))
end
  4 commentaires
Sankarganesh P
Sankarganesh P le 17 Oct 2022
Thank you very much
KSSV
KSSV le 17 Oct 2022
Thanks is accepting/ voting the answer. :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Voronoi Diagram dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by