After create a polygon how to write name inside it so you can differeniate between it and the other polygons?

 채택된 답변

Star Strider
Star Strider 2021년 1월 20일

2 개 추천

Use the text function.
Try this:
pgon = polyshape([1 3 5 7],[2 6 4 1]);
[xc,yc] = centroid(pgon);
figure
plot(pgon)
axis('equal')
text(xc,yc, sprintf('Polygon with centroid (%.2f, %.2f)', xc, yc), 'HorizontalAlignment','center', 'VerticalAlignment','middle')
producing:
.

댓글 수: 2

ZeKkEn NoName
ZeKkEn NoName 2021년 1월 21일
Thanks
Star Strider
Star Strider 2021년 1월 21일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Polygonal Shapes에 대해 자세히 알아보기

질문:

2021년 1월 20일

댓글:

2021년 1월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by