n=10; for i=1:1:n x(i)=rand; y(i)=rand; end [a,b]=pol2cart(x,y); k = convhulln(a,b); plot(a(k),b(k),'r-',a,b,'b+')