Help CenterHelp Center
Discard changes to interface dictionary
Since R2023a
discardChanges(dictObj)
example
discardChanges(dictObj) discards any changes made to the interface dictionary dictObj since the last time the dictionary was saved.
dictObj
collapse all
Add a new enumeration type to an interface dictionary and then discard the changes.
Verify that the dictionary does not contain changes.
dictAPI = Simulink.interface.dictionary.open('MyInterfaces.sldd'); isDirty(dictAPI)
ans = logical 0
Add enumeration type, MyEnum.
MyEnum
addEnumType(dictAPI,'MyEnum'); getDataTypeNames(dictAPI)
ans = 1×8 cell array Columns 1 through 5 {'MyEnum'} {'myAliasType1'} {'myAliasType2'} {'myAliasType3'} {'myColor'} Columns 6 through 8 {'myStructType1'} {'myStructType2'} {'myValueType1'}
Discard the change.
discardChanges(dictAPI); getDataTypeNames(dictAPI)
ans = 1×7 cell array Columns 1 through 4 {'myAliasType1'} {'myAliasType2'} {'myAliasType3'} {'myColor'} Columns 5 through 7 {'myStructType1'} {'myStructType2'} {'myValueType1'}
Simulink.interface.Dictionary
Interface dictionary, specified as a Simulink.interface.Dictionary object. Before you use this function, create or open dictObj by using Simulink.interface.dictionary.create or Simulink.interface.dictionary.open.
Simulink.interface.dictionary.create
Simulink.interface.dictionary.open
Introduced in R2023a
Simulink.interface.Dictionary | addEnumType | getDataTypeNames | isDirty | showChanges | Simulink.interface.dictionary.create | Simulink.interface.dictionary.open
addEnumType
getDataTypeNames
isDirty
showChanges
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office