removeSetting

Deletes a setting from a settings group.

Category: Environment and Settings > System Commands

Syntax

removeSetting(G, name)

Removes the setting name from group G.

Description

All value layers of the setting are discarded with it. Use hasSetting first when the setting may not exist.

Input arguments

G
A SettingsGroup object.
name
Name of the setting to delete.

Example

Add and remove a setting

s = settings;
g = addGroup(s, 'tmpgroup');
addSetting(g, 'A', 'PersonalValue', 1);
disp(hasSetting(g, 'A'))
removeSetting(g, 'A');
disp(hasSetting(g, 'A'))
removeGroup(s, 'tmpgroup');
Output
   1
   0

See also

addSetting hasSetting removeGroup settings