discardChanges
Discard changes to data dictionary
Description
discardChanges( discards all
changes made to the specified data dictionary since the last time changes to the dictionary
were saved using the dictionaryObj)saveChanges function.
discardChanges also discards changes made to referenced data
dictionaries. The changes to the target dictionary and its referenced dictionaries are
permanently lost.
Examples
Input Arguments
Alternatives
Discard changes to a data dictionary by using a
Simulink.data.DataConnectionobject function.Get the value for the variable
xin a data dictionary.dd = Simulink.data.connect("myDictionary.sldd"); dd.xans = 1Update the variable
xand get its new value.dd.x = dd.x + 2; dd.x
ans = 3Discard the changes to the data dictionary. Variable
xis set back to its original value.success = discardChanges(dd); dd.x
ans = 1You can use the Model Explorer window to discard changes to data dictionaries. See View and Revert Changes to Dictionary Entries for more information.
Version History
Introduced in R2015a