checkMixedTypesExpression

Checks expressions and conditions to see if operands or operators of logical and numerical types were mixed. Mixing operand types in an expression or condition decreases code readability and robustness. Some examples of expressions that will be reported by this check are:

a = 8.9 || 9.1;         % Numbers and logical operator ||.
b = isempty(a) * 3;     % MATLAB-installed function 'isempty' and the multiplication operator.
c = a * b & a > b;   % Multiplication and the logical operator &.
d = a / ~c;           % Division and the 'not' operator.

Since CC4M cannot reliably determine a variable's type, this check does not use such information. Only information known at the expression or condition itself will be used. Aside from the operators themselves, a non-exhaustive list of MATLAB-installed functions (including isempty as shown in the example) is used to determine the operand types.

Exemption tag: %@ok<MIXOT>