function [xx]=distinct(x)
% prog to find distinct values
%
% find the number of unique values of x 
%
   icountx=0;
   for idx=1:length(x)-1;
           id=[];
           id=find(x(idx)==x(idx+1:length(x)));
%           if x(idx)~=x(idx+1);
%             id=[ ];
%           end;
            if id==[];
            icountx=icountx+1;
            xp(icountx)=x(idx);
            end;
   end;
xp=[xp x(length(x))];   
%
% sort this xp vector
%
  xp=sort(xp);
%


