Finding the area inside a convex hull
x1 = rand(1,10);
y1 = rand(1,10);
vi = convhull(x1,y1);
polyarea(x1(vi),y1(vi))
plot(x1,y1,'.')
axis equal
hold on
fill ( x1(vi), y1(vi), 'r','facealpha', 0.5 );
hold off
Find the treasures in MATLAB Central and discover how the community can help you!
Find the treasures in MATLAB Central and discover how the community can help you!
x1 = rand(1,10);
y1 = rand(1,10);
vi = convhull(x1,y1);
polyarea(x1(vi),y1(vi))
plot(x1,y1,'.')
axis equal
hold on
fill ( x1(vi), y1(vi), 'r','facealpha', 0.5 );
hold off
评论
要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。