# HG changeset patch # User jwe # Date 1156454861 0 # Node ID d542d919783961dce51ee8fc06f65b8f2cfe4156 # Parent be252143f5e1ec4fc5e288d562b2fa5d5a38173e [project @ 2006-08-24 21:24:53 by jwe] diff -r be252143f5e1 -r d542d9197839 scripts/ChangeLog --- a/scripts/ChangeLog Thu Aug 24 20:06:24 2006 +0000 +++ b/scripts/ChangeLog Thu Aug 24 21:27:41 2006 +0000 @@ -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 -r be252143f5e1 -r d542d9197839 scripts/set/setdiff.m --- 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.';