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.

jc_0491: Reuse of variables within a single Stateflow scope

ID: Title

jc_0491: Reuse of variables within a single Stateflow scope

Priority

Recommended

Scope

MAAB

MATLAB Versions

All

Prerequisites

None

Description

The same variable should not have multiple meanings (usages) within a single Stateflow state.

Correct

Variable of loop counter must not be used other than loop counter.

Incorrect

The meaning of the variable i changes from the index of the loop counter to the sum of a+b.

Correct

tempVar is defined as local scope in both SubState_A and SubState_B.

Rationale

  • Readability

  • Verification

  • Code Generation

Last Changed

V2.2

Model Advisor Check

Not applicable

Introduced in R2010a

Was this topic helpful?