Drawing polygons from vertex coordinates

조회 수: 4 (최근 30일)
Akhil
Akhil 2024년 4월 1일
답변: Steven Lord 2024년 4월 1일
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

답변 (1개)

Steven Lord
Steven Lord 2024년 4월 1일
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)?

카테고리

Help CenterFile Exchange에서 Elementary Polygons에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by