Say I have a vector x, and a (short) list of values v to match against. I want to find which elements of x are present in v. For example, if
x = {10 11 12 13 12 13 14 15};
v = {12 13};
I want to obtain the vector {3 4 5 6}, these being the elements of x whose values are either 12 or 13. Is there a simple way to do this, without having to do an explicit loop over all the elements of v?