multisetdiff
by Ben Petschel
09 Sep 2009
(Updated 14 Sep 2009)
like setdiff, but any repeated elements of A are removed only once for each time they occur in B
|
Watch this File
|
| File Information |
| Description |
setdiff for multisets. multisetdiff(A,B) removes repeated elements of A only once for each time they occur in B.
Example:
multisetdiff([1,1,2,2],[1,1,2]) % returns 2
To work with cell arrays of strings or using the rows feature this version requires LEXCMP (see below). The current version does not work for non-string cell arrays (unless you have an implementation of SORT for cell arrays). Non-cell arrays can in principle be any objects for which SORT, SIGN, MINUS and comparison operations are defined.
See the help for more details.
|
| Acknowledgements |
The author wishes to acknowledge the following in the creation of this submission:
lexcmp
|
| MATLAB release |
MATLAB 7.8 (R2009a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 14 Sep 2009 |
added support for inf/nan values |
|
Contact us at files@mathworks.com