%% Driver for the lbgUpdate - Example % Same as lbgExample2, except with different densities X1=rand(100,2)+repmat(randn(1,2),100,1); X2=rand(15,2)+repmat(randn(1,2),15,1); X=[X1;X2]; clear X1 X2 [mm,nn]=size(X); Temp=randperm(mm); NumClusters=8; %C=X(Temp(1:NumClusters),:); %C=randn(NumClusters,2); C=X(101:109,:); plot(C(:,1),C(:,2),'r*',X(:,1),X(:,2),'k.'); pause for j=1:10 [P,C,Err]=lbgUpdate(X,C); T(j)=mean(Err); T(j) voronoi(C(:,1),C(:,2)); hold on plot(X(:,1),X(:,2),'k.',C(:,1),C(:,2),'r*'); pause hold off end