voronoin - is there any conection between output vertices and cells c and v and input coordinate vector?
2 views (last 30 days)
Show older comments
I am using comand [c,v] = voronoin(x); first I remove all the cells c, which have at least 1 element == 1:
ind = cellfun(@(xx)all(xx~=1),c);
Afterwards, using custom cellfun I am calculateing area of each voronoi cells Ap, and indices of each voronoi cell Vp:
[Vp,Ap] = cellfun(@ voronoinVert,c,v,'UniformOutput',false);
That works fast and perfect. Finally I want to know which of my input point x is contained in each of voronoi cell c with vertices Vp. I am runing inpolygon, which is very good function, but my x vector contains on average 5e5 points. I am filtering all the points x with coordinates outside the bounding box of given voronoi cell, but still it takes 10-20 min for iteration. So, to recapitulate, is there any connection bwtween ordering of input x points to the ordering of output c and v, so I could avoid inpolygon?
thank you very much for the help,
Ina
2 Comments
Answers (0)
See Also
Categories
Find more on Voronoi Diagram in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!