Why not simply using the variance:

var(x) == 0

If all the elements of x are equal, you will get a variance of 0.