No products are associated with this question.
If you are comparing vectors or arrays, please be sure to note this behavior of if
An evaluated expression is true when the result is nonempty and contains all nonzero elements (logical or real numeric). Otherwise, the expression is false.
So when you have
if A < B
and A or B is a vector (or a matrix) then the "if" is only considered true if all A < B are true.
Play games and win prizes!Learn more