This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

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

Model Advisor Check

By Task > Modeling Standards for MAAB > Model Architecture > Check use of single variable variant conditionals

For check details, see Check use of single variable variant conditionals.

Introduced in R2013a