Main Content

revert

Class: OptimizationResult

Revert system data types and settings changed during optimization to original state

Since R2020a

Description

revert(result) reverts the changes made during optimization, including system settings and data types, to their original state.

Input Arguments

expand all

OptimizationResult object to revert to its state before optimization.

Considerations

If the system you are optimizing contains a MATLAB Function block, the optimization replaces the block with a Variant Subsystem block in which one variant contains the original MATLAB Function block and the other variant contains the block with the optimized, fixed-point data types. When you revert a system containing a MATLAB Function block, the variant containing the original MATLAB Function block is set as the active variant.

Similarly, if the system you are optimizing contains a Stateflow® chart, the optimization process first replaces all data types in the chart with Simulink.NumericType objects. When you revert a system containing a Stateflow chart, the data type of the Simulink.NumericType objects are restored to their original data type, but the NumericType objects still exist in the model.

In both of these cases, when you revert your system, the model behaves numerically identically to how it did before the optimization, however, the model is not actually identical to its state before optimization.

Version History

Introduced in R2020a