MATLAB Answers

Boolean operation of A not B

19 views (last 30 days)
Hello guys,
I have 2 vectors "a" and "b" with b bigger than a. How can I create a new vector "c" with all the elements of b not in a.
Thank you in advance

Accepted Answer

Matt J
Matt J on 10 Apr 2021
c=setdiff(b,a)
  1 Comment
Alcide Bertocco
Alcide Bertocco on 10 Apr 2021
Thank you very much, it works!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!