MATLAB: A < b < c < d, what does this Boolean return for different values of a, b, c and d

MATLAB

if I have an if statement: if a < b < c < d
what is the behavior here where a, b, c and d are numeric. Is there an order of operation?

Best Answer

As stated on this documentation page, all the relational operators are at the same level of precedence. Therefore they are evaluated left to right as stated at the beginning of that page.
This does not, as you might think, return true if a, b, c, and d are in strictly ascending order. To test that condition I would use the issorted function on the vector [a b c d] with one of the direction flags.