Main Content

Enable continuous-time MATLAB functions to write to initialized persistent variables

Option to allow continuous-time MATLAB functions to write to initialized persistent variables

Since R2021a

Model Configuration Pane: Simulation Target

Description

The Enable continuous-time MATLAB functions to write to initialized persistent variables parameter controls whether continuous-time MATLAB® functions can write to initialized persistent variables.

Settings

off (default) | on
off

Continuous-time MATLAB functions can only initialize and read persistent variables.

on

Continuous-time MATLAB functions can initialize, read, and write to persistent variables.

Enable this parameter to ensure consistent functionality in later releases for models designed using R2017b and earlier.

Tips

When you initialize a persistent variable, check that the variable is empty before assigning a value. For more information, see Initialize Persistent Variables in MATLAB Functions.

Recommended Settings

ApplicationSetting
Debugging

No impact

Traceability

No impact

Efficiency

No impact

Safety precaution

No impact

Programmatic Use

Parameter: LegacyBehaviorForPersistentVarInContinuousTime
Default: string | character vector
Values: 'on' | 'off' |
Default: 'off'

Version History

Introduced in R2021a