clearTemporaryValue
Removes the temporary value of a setting.
Category: Environment and Settings > System Commands
Syntax
clearTemporaryValue(S)
Clears the temporary layer of setting S; the other layers are kept.
Description
A setting keeps separate layers of value, and S.ActiveValue returns the first one set in the order temporary, personal, installation, factory. clearTemporaryValue empties only the temporary layer, so afterwards hasTemporaryValue(S) is false and ActiveValue falls back to the next layer. If no layer is left, reading ActiveValue is an error.
Input arguments
S- A
matlab.settings.Settingobject.
Example
Clear the temporary value
s = settings;
g = addGroup(s, 'demo');
a = addSetting(g, 'Level');
a.TemporaryValue = 5;
disp(hasTemporaryValue(a))
clearTemporaryValue(a);
disp(hasTemporaryValue(a))
removeGroup(s, 'demo');
Output
1
0