- Compute the Voronoi Diagram: Use “voronoin” function to compute the Voronoi diagram for the points in “Q”
- Identify Unbounded Cells: In a Voronoi diagram, unbounded cells are those that extend to infinity. These cells are typically associated with Voronoi vertices that lie on the boundary of the convex hull of “Q”. Use “convhull” function for the above operation.
- Bounding Box: You can create a large bounding box around your data points to help identify which Voronoi cells are unbounded. This is done by extending the range of your data points slightly beyond their “min” and “max” values.
- Check for Unbounded Cells: For each Voronoi cell, check if any of its vertices lie outside the bounding box. If so, the cell is unbounded. Use “inpolygon” function to check which points in “P” lie within these unbounded cells.
- “voronoin” - https://www.mathworks.com/help/matlab/ref/voronoin.html
- “convhull” - https://www.mathworks.com/help/matlab/ref/convhull.html
- “inpolygon” - https://www.mathworks.com/help/matlab/ref/inpolygon.html