You can compare values with bsxfun:
A = A(all(bsxfun(@ne, A(:), B(:).'), 2))
This approach is especially good if you need to handle floating-point numbers (whereismember
fails):
A(all(abs(bsxfun(@minus, A(:), B(:).')) >= eps, 2))
Instead of eps, you can set any tolerance threshold you want.