function [n1,n2,xf,yf,xg,yg,xh,yh]=Partition(xi,eta,XY,N)
% PARTITION  Partitions the data XY into three data sets
%    [n1,n2,xf,yf,xg,yg,xh,yh]=Partition(xi,eta,XY,N) partition the
%    date set in XY into three subsets according to xi and eta. 

n1=sum(XY(:,1)<xi); n2=sum(XY(:,1)<eta);
xf=XY(1:n1,1); yf=XY(1:n1,2);
xg=XY(n1+1:n2,1); yg=XY(n1+1:n2,2);
xh=XY(n2+1:N,1); yh=XY(n2+1:N,2);