How to get the numbers that do not overlap with another matrix?

6 views (last 30 days)
Imagine, I have a matrix A = [1, 2, 5, 7, 9]; and B = [1,3,5];
How do I find all numbers in Matraix A that do not already overlapping with B? In this case, 1 and 5 in A have overlapping numbers in B, so 2, 7, 9 would be my answer.
Thank you.

Accepted Answer

madhan ravi
madhan ravi on 10 Apr 2019
setdiff(A,B)

More Answers (0)

Tags

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!