MATLAB: How to discard unsaved changes to a Data Dictionary

datadeletedictionarydiscarddiscardchangessimulinkunsaved

How to discard unsaved changes to a Data Dictionary?

Best Answer

In the tempdir there is an SLDDC file that stores the changes that have not been saved to the SLDD file. If MATLAB crashes, we are able to use this file and restore the pending changes.
To instead discard the changes you should open the Data Dictionary and discard the changes with "discardChanges":
>> h = Simulink.data.Dictionary.open('myDictionary.sldd')
>> h.discardChanges
Notice that the property HasUnsavedChanges goes from true to false. Please refer to this link for more information: