Documentation Center

  • Trial Software
  • Product Updates

na_0037: Use of single variable variant conditionals

ID: Title

na_0037: Use of single variable variant conditionals

Priority

Recommended

Scope

NA-MAAB

MATLAB Versions

All

Prerequisites

None

Description

Variant conditional expressions should be composed using either a single variable with compound conditions or multiple variables with a single condition. The default variant is an exception to the second rule.

Correct: Multiple variables (INLINE / FUNCTION with single condition per line

Correct: Single variable compound conditions

Incorrect: Multiple variables, compound conditions

Note

Use of enumerated variables is preferred in the Condition expressions. To improve the readability of the screenshots used in the examples, numerical values were used.

Rationale

  • Readability

  • Code Generation

  • Simulation

Last Changed

V3.0

Was this topic helpful?