Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan 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

Introduced in R2013a

Was this topic helpful?