multisetdiff

版本 1.1.0.0 (2.6 KB) 作者: Ben Petschel
like setdiff, but any repeated elements of A are removed only once for each time they occur in B
987.0 次下载
更新时间 2009/9/14

查看许可证

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.

引用格式

Ben Petschel (2025). multisetdiff (https://www.mathworks.com/matlabcentral/fileexchange/25267-multisetdiff), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2009a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Characters and Strings 的更多信息
致谢

参考作品: lexcmp

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

added support for inf/nan values

1.0.0.0