I need to find elements of a vector that are less than one of more elements that come after it. It\'s easy to do in a loop:
x = some_vector_values; for m = 1
One-liner version
comparisons = any(triu(bsxfun(@gt,x(:).',x(:))),2)