Main Content

removeSetting

Remove setting

Description

example

removeSetting(parentgroup,name) removes a setting called name from the specified parent settings group.

Examples

collapse all

Create a settings group and add a new setting to the group. Then, remove the setting.

Use the settings function to access the root of the settings tree and then create the settings group mysettings.

s = settings;
addGroup(s,'mysettings');

Add the setting MyWorkAddress to mysettings.

addSetting(s.mysettings,'MyWorkAddress','PersonalValue','3 Apple Hill Drive');
s.mysettings.MyWorkAddress
ans = 
  Setting 'mysettings.MyWorkAddress' with properties:
       ActiveValue: '3 Apple Hill Drive'
    TemporaryValue: <no value>
     PersonalValue: '3 Apple Hill Drive'
      FactoryValue: <no value>

Remove the setting MyWorkAddress from mysettings.

removeSetting(s.mysettings,'MyWorkAddress');
s.mysettings
ans = 
  SettingsGroup 'mysettings' with no properties.

Input Arguments

collapse all

Parent settings group to remove the setting from, specified as a SettingsGroup object. Use the settings function to access the root settings group object and all the available settings groups.

Name of the setting to remove, specified as a character vector or string scalar. If name does not exist in the specified settings group, MATLAB® throws an error.

Introduced in R2019b