SettingsGroup

Object that represents a group of settings and nested groups.

Category: Environment and Settings > System Commands

Syntax

G = addGroup(parent, name)

Groups are created with addGroup; settings returns the root group.

Description

A SettingsGroup is a container. Its children are reached with dot syntax (G.name) and can be settings or other groups. The methods are addGroup, addSetting, hasGroup, hasSetting, removeGroup and removeSetting. Displaying a group lists its children.

Output arguments

G
A matlab.settings.SettingsGroup object.

Example

Build a small tree

s = settings;
g = addGroup(s, 'demo');
sub = addGroup(g, 'inner');
addSetting(g, 'Level', 'PersonalValue', 2);
g
disp(hasGroup(g, 'inner'))
removeGroup(s, 'demo');
Output
g = 
  SettingsGroup 'demo' with properties:

    Level: [1×1 Setting]
    inner: [1×1 SettingsGroup]
   1

See also

settings addGroup addSetting Setting