There must be a simple matlab way of doing this. I have a row vector and I want to check if all of the elements are equal. Brute forcing this in a loop is easy, but lookin
I think it can be as simple as
if all(v == v(1))
Another method would be
if range(v) == 0
Another solution:
sum(abs(diff(v))) == 0
numel(unique(v))==1
How about: max(v) == min(v)? :-)
max(v) == min(v)