ADDED mttroot/mtt/bin/trans/m/unique.m Index: mttroot/mtt/bin/trans/m/unique.m ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/m/unique.m @@ -0,0 +1,25 @@ +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; + +