diff scripts/set/setdiff.m @ 5967:d542d9197839 ss-2-9-8

[project @ 2006-08-24 21:24:53 by jwe]
author jwe
date Thu, 24 Aug 2006 21:27:41 +0000
parents b3478d7a0486
children 34f96dd5441b
line wrap: on
line diff
--- a/scripts/set/setdiff.m	Thu Aug 24 20:06:24 2006 +0000
+++ b/scripts/set/setdiff.m	Thu Aug 24 21:27:41 2006 +0000
@@ -56,7 +56,7 @@
       [dummy, idx] = sortrows ([c; b]);
       ## Eliminate those elements of a that are the same as in b.
       n = length (dummy);
-      c(idx(dummy(1:n-1) == dummy(2:n)), :) = [];
+      c(idx(find (dummy(1:n-1) == dummy(2:n))), :) = [];
     endif
   else
     c = unique (a);
@@ -66,7 +66,7 @@
       [dummy, idx] = sort ([c(:); b(:)]);
       ## Eliminate those elements of a that are the same as in b.
       n = length (dummy);
-      c(idx(dummy(1:n-1) == dummy(2:n))) = [];
+      c(idx(find (dummy(1:n-1) == dummy(2:n)))) = [];
       ## Reshape if necessary.
       if (size (c, 1) != 1 && size (b, 1) == 1)
 	c = c.';