Mercurial > hg > octave-lyh
diff scripts/set/setxor.m @ 9481:a3ae7abaf659
support cellstrs in setxor
author | Pieter Eendebak <pieter.eendebak@gmail.com> |
---|---|
date | Tue, 04 Aug 2009 09:33:33 +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]) = [];