Let's take a simpler example.
check = @(x) (x ~= 1) | (x ~= 2)
Does this return true for 1.5?
Does it return true for 3?
Does it return true for 1?
Whoops. Why? Well, 1 is equal to 1 so (x ~= 1) returns false. But 1 is not equal to 2 so (x ~= 2) returns true. And false or true returns true.
For something like this, you could use round (to make sure x is an integer value) and > and < to determine if it's in the bounds that you want. Alternately, if you want to limit x to being in a specific set of values use ismember.