how can i plot the convex hull????

How can I plot the convex hull(k) in the axes:
net = [1:n;rand([1,n])*x;rand([1,n])*y];
net1 = net;
plot(net(2,:),net(3,:),'bo','MarkerSize',5,'MarkerFaceColor','b');
xx=net(2,:);
yy=net(3,:);
dt = DelaunayTri(xx',yy');
P = [xx',yy'];
[K AV] = convexHull(dt)
I try different plot but they don't work:
%trisurf(K, dt.xx(:,1),dt.xx(:,2),dt.xx(:,3), 'FaceColor', 'cyan')
%plot(dt.xx(K,1),dt.xx(K,2), 'r');
%K =convexHull(dt);
%plot (K,'-.r');
and I have different error message
plz help me

 採用された回答

Image Analyst
Image Analyst 2015 年 11 月 8 日

1 投票

Add this code:
hold on;
plot(xx(K), yy(K), 'r');
and don't use that function, like the help says. It's been deprecated. Use convhull() instead.

1 件のコメント

ali hadjer
ali hadjer 2015 年 11 月 8 日
THANK YOU SO MUCH ITS WORK :)

サインインしてコメントする。

その他の回答 (1 件)

ISRAA ADIL HAYDER AL-RUBAYE
ISRAA ADIL HAYDER AL-RUBAYE 2020 年 9 月 5 日

0 投票

you have to specify the x,y coordinates of the nodes of the network that represents width and length of the network respectively ....
so the width,length should be assigned to nombers for example : 100
x=100;
y=100;
hopefully , thats going to work
israa
iraq

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by