reportBinaryExpressions

This report is especially relevant for m-code that will be used for code generation. It reports all binary expressions for which the order of evaluation might matter. For this report, an expression is a binary expression if it uses a binary operator. These operators are: :, ^, ==, <=, >=, ~=, >, <, &, &&, |, ||, +, -, *, .``* and /. An expression will be reported by reportBinaryExpressions if any of these are met:

  • A user-defined function is called on both sides of the operator.

  • A user-defined function is called on one side of the operator and a relevant variable is accessed on the other side of the operator. Relevant variables are:

    • Handle objects.

    • Persistent variables

    • Global variables

If a variable is accessed for which the datatype could not be reliably obtained, it is also considered a relevant variable when the fourth preference described in section Preferences is set to false. The datatype of variables used in the code are unknown for example for the inputs of the checked main function, or outputs of user-defined function calls. Disabling the preference may lead to fewer (incorrect) results being reported.

Exemption tag: %@ok<BINEX>