setdiff with reptitions ?
7 次查看(过去 30 天)
显示 更早的评论
i have two array A ,B i need to know all elements that inside A but not B including reptitons ,thx .
0 个评论
采纳的回答
Star Strider
2018-11-27
编辑:Star Strider
2018-11-27
Experiment with the ismember (link) funciton or if you are using floating-point numbers, ismembertol (link):
A = randi(9, 1, 10)
B = randi(5, 1, 8)
L = ismember(A, B)
Out = A(L)
or:
Out = A(~L)
depending on the result you want.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!