Illustration to logical function:
In addition to such logical operators, the MATLAB also has a function xor, that is the exclusive or function. It returns the logical true if one of the arguments is true. For illustration, in the subsequent only the first argument is true,therefore the answer is true:
>> xor(3 < 5, 'a' > 'c')
ans =
1
In this illustration, both the arguments are true therefore the result is false:
>> xor (3 < 5, 'a' < 'c')
0
Given that the logical values of true and false in variables x & y, the truth table shown below explains how the logical operators work for all the combinations. Keep in mind that the logical operators are commutative (example, x || y is similar as y || x).