1

In matlab, how can I implement the following?

Say that I have some set A and another set B, both of which have some elements. How can I write a function that returns only the values of B that are not in A (relative complement of A in B B\A?

Thanks.

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Simplicity
  • 47,404
  • 98
  • 256
  • 385

1 Answers1

3

use setdiff

dif = setdiff( A, B )
Shai
  • 111,146
  • 38
  • 238
  • 371