function data=xyn2data(m)

% XYN2DATA    Convert multiple (X,Y) co-ordinates to dataset.
%
%             Example: 
%
%             m=[1 1 10; 0.5 0.6 3], data=xyn2data(m)
%
%             Christian C. Beardah 1996

[r,c]=size(m);
data=zeros(sum(m(:,3)),2);
count=1;

for k=1:r,
  n=m(k,3);
  data([count:(count+n-1)],1:2)=ones(n,1)*m(k,1:2);
  count=count+n;
end;