Mercurial > hg > octave-nkf
diff scripts/set/setxor.m @ 12054:e868e6276b5c release-3-2-x
support cellstrs in setxor
author | Pieter Eendebak <pieter.eendebak@gmail.com> |
---|---|
date | Thu, 06 Aug 2009 07:32:53 +0200 |
parents | 1bf0ce0930be |
children | f7cc8f30f3b8 |
line wrap: on
line diff
--- a/scripts/set/setxor.m +++ b/scripts/set/setxor.m @@ -71,7 +71,11 @@ na = numel (a); nb = numel (b); [c, i] = sort ([a(:); b(:)]); n = length (c); - idx = find (c(1:n-1) == c(2:n)); + if (iscell (c)) + idx = find (strcmp (c(1:n-1), c(2:n))); + else + idx = find (c(1:n-1) == c(2:n)); + endif if (! isempty (idx)) c([idx, idx+1]) = []; i([idx, idx+1]) = [];