답변 (2개)

Star Strider
Star Strider 2016년 2월 2일

1 개 추천

Here is one way:
N= 12; % Number Of Sides To Polygon
a = sort(rand(N,1))*2*pi;
r = randi(9, N, 1);
x = cos(a).*r;
y = sin(a).*r;
figure(1)
plot([x; x(1)], [y; y(1)])
This creates a randomly-shaped polygon. Change it to produce the sort of shape you want.

카테고리

도움말 센터File Exchange에서 Computational Geometry에 대해 자세히 알아보기

질문:

2016년 2월 2일

답변:

2016년 2월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by