# HG changeset patch # User jwe # Date 1156454861 0 # Node ID d542d919783961dce51ee8fc06f65b8f2cfe4156 # Parent be252143f5e1ec4fc5e288d562b2fa5d5a38173e [project @ 2006-08-24 21:24:53 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -5,7 +5,7 @@ 2006-08-24 Søren Hauberg - * miscellaneous/bincoeff.m, set/setdiff.m, specfun/factorial.m: + * miscellaneous/bincoeff.m, specfun/factorial.m: Use logical indexing instead of indices computed by calling find on the logical index. diff --git a/scripts/set/setdiff.m b/scripts/set/setdiff.m --- a/scripts/set/setdiff.m +++ b/scripts/set/setdiff.m @@ -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.';