資源簡介
凸包算法 二元分類問題 matlab程序 很好用
代碼片段和文件信息
function?chull=ConvHull2D(xy)
%??chull=ConvHull2D(xy)?returns?indices?into?the?x?and?y?vectors?of?the?points?on
%?????the?convex?hull.?Colinear?points?wont?be?part?of?the?convex?hull.
%?
%????????Input:
%????????????????x[nx1]?:?vectors?of?x?points
%????????????????y[nx1]?:?vectors?of?y?points
%????????Output:
%????????????????chull[mx1]:?index?of?convex?hull?points
%
%?????Example:
%???????N=20;
%???????x=rand(N1);
%???????y=rand(N1);
%???????chull=ConvHull2D(xy);
%???????figure(1)
%???????hold?on
%???????plot(xy‘k.‘)
%???????plot(x(chull)y(chull));
%???????title(‘Convex?Hull‘)
%
%
%?????See?also?convhulln?delaunay?voronoi
%??????????????polyarea?qhull.
%
%
%Author:?Luigi?Giaccari
%Last?Update:?4/12/2008
%Creation:?27/11/2008
%How?does?it?work?
評(píng)論
共有 條評(píng)論