Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating areas of polygons defined by "voronoin" function call

Status
Not open for further replies.

vuie

Computer
Oct 18, 2008
1
Hi,
I'm in desperate need of some help, or even just pointers about the below code. I know nothing much about matlab, yet have to figure this out. I'd appreciate your time and consideration.

I need to calculate the area of fill for each cells generated by "voronoin" function.

I know that "voronoin" returns an array of Vertices and Cells: [V,C]=voronoin(data).

And i have read that I could use "polyarea" to calculate the area of each cell, but "polyarea" takes vertices of the Vectors.

I'm completely lost at how to bridge the output of "voronoin" to the input of "polyarea" to get the result i need.


ANY help is GREATLY appreciated.
Thank you very much.





Here's how i load my data and call "voronoin"
----------------CODE------------------
data=[
9.087 2.605
7.451 1.605
8.898 2.178
7.962 7.557
9.982 0.661
9.799 7.771
8.189 -0.728
8.427 5.775
8.489 0.392
8.638 4.853
];
[V,C]=voronoin(data);
--------------CODE-------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor