How to check if all of the elements in an array are the same, in matlab?
I think it can be as simple as
if all(v == v(1))
Another method would be
if range(v) == 0
Another solution:
numel(unique(v))==1
I think it can be as simple as
if all(v == v(1))
Another method would be
if range(v) == 0
Another solution:
numel(unique(v))==1