Drawing polygons from vertex coordinates

4 visualizaciones (últimos 30 días)
Akhil
Akhil el 1 de Abr. de 2024
Respondida: Steven Lord el 1 de Abr. de 2024
I have a plane of 100 x 100 mm dimension, which include mutliple polygons inside of it. I have 128 vertex coordinates from which i need to draw 26 polygons. KIndly suggest how to draw polygon using the data

Respuestas (1)

Steven Lord
Steven Lord el 1 de Abr. de 2024
See the polyshape function.
If you're hoping MATLAB will automatically "figure out" what the polygons should be from your scattered coordinates, I don't think there's a function to do that. If you had this set of points:
x = [0, 1, 1, 0, 0.5]
y = [0, 0, 1, 1, 0.5]
plot(x, y, 'o')
axis([-1 2 -1 2])
axis square
What should be "the" polygon or polygons created from those points? Should it be the square around the four outermost points? Should it be that square with one of the triangles consisting of two adjacent vertices and the center point "cut out" (and if so, which of the four triangles do you want to cut out)?

Categorías

Más información sobre Elementary Polygons en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by