Clear Filters
Clear Filters

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

5 views (last 30 days)
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]

Accepted Answer

KSSV
KSSV on 17 Oct 2022
Edited: KSSV on 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 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Voronoi Diagram in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!