|MATLAB Function Reference|
n-D Voronoi diagram
[V,C] = voronoin(X)
returns Voronoi vertices
V and the Voronoi cells
C of the Voronoi diagram of
V is a
n array of the
numv Voronoi vertices in
n-D space, each row corresponds to a Voronoi vertex.
C is a vector cell array where each element contains the indices into
V of the vertices of the corresponding Voronoi cell.
X is an
n array, representing
n-D points, where
n > 1 and
m >= n+1.
The first row of
V is a point at infinity. If any index in a cell of the cell array is
1, then the corresponding Voronoi cell contains the first point in
V, a point at infinity. This means the Voronoi cell is unbounded.
You can plot individual bounded cells of an n-D Voronoi diagram. To do this, use
convhulln to compute the vertices of the facets that make up the Voronoi cell. Then use
patch and other plot functions to generate the figure. For an example, see Tessellation and Interpolation of Scattered Data in Higher Dimensions in the MATLAB documentation.
for loop to see the contents of the cell array
In particular, the fifth Voronoi cell consists of 4 points:
voronoin is based on Qhull . It uses the Qhull joggle option (
'QJ'). For information about
qhull, see http://www.geom.umn.edu/software/qhull/. For copyright information, see http://www.geom.umn.edu/software/download/COPYING.html.
 Barber, C. B., D.P. Dobkin, and H.T. Huhdanpaa, "The Quickhull Algorithm for Convex Hulls," ACM Transactions on Mathematical Software, Vol. 22, No. 4, Dec. 1996, p. 469-483. Available in HTML format at http://www.acm.org/ pubs/citations/journals/toms/1996-22-4/p469-barber/ and in PostScript format at ftp://geom.umn.edu/pub/software/qhull-96.ps.
 National Science and Technology Research Center for Computation and Visualization of Geometric Structures (The Geometry Center), University of Minnesota. 1993.