Artifact 6397cfa01f761b2229459ddc8239995ae3cf9d353f52ae89e6d2b3d4db4d90f3:
- Executable file mtt/bin/trans/m/mtt_isunique.m — part of check-in [af3953deae] at 2021-03-01 11:39:42 on branch master — Cleanup repository after cvs2git conversion. (user: jeff@gridfinity.com, size: 642) [annotate] [blame] [check-ins using] [more...]
- Executable file mttroot/mtt/bin/trans/m/mtt_isunique.m — part of check-in [4f71d8387c] at 2012-10-15 19:22:44 on branch origin/master — mtt_isunique replaces unique which masks a built-in function. (user: geraint@users.sourceforge.net, size: 642) [annotate] [blame] [check-ins using]
function u = mtt_isunique(x); % if all the elements of x are different, returns 1 else returns 0 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ % %% Revision 1.1 1997/09/18 19:38:58 peterg % %% Initial revision % %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% n = length(x); u=1 disp("--checking uniqueness --") x for i=1:n for j = 1:i-1 if iscell(x) if x{i}==x{j} u = 0 break; end; else if x(i)==x(j) u = 0 break; end; end end; end;