File mttroot/mtt/bin/trans/m/unique.m artifact feff63e110 part of check-in d247ecf1a2
function u = unique(x); % if all the elements of x are different, returns 1 else returns 0 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% n = length(x); u=1; for i=1:n for j = 1:i-1 if x(i)==x(j) u = 0; break; end; end; end;