function removeGroup(obj, varargin)
% removeGroup    Remove setting group
%
%  removeGroup(PARENTGROUP,NAME) removes the settings group specified by name and all 
%  of its child settings groups and settings from the parent settings group PARENTGROUP.
%
%  removeGroup returns an error if the user settings file is read-only or if the setting
%  does not exist.
%
%  Examples:
%    Assume the settings tree contains these settings groups and settings
%                             root
%                             /  \     
%                       matlab   mysettings
%                           ......    \
%                                  mainwindow 
%                                          \ 
%                                        BgColor
%                                               
%  
%  Remove the settings group 'mainwindow' from the settings group 'mysettings'. This also 
%  removes all the child settings groups and settings:
% 
%      >> s = settings;
%      >> removeGroup(s.mysettings, 'mainwindow');
%
%   See also matlab.settings.SettingsGroup, matlab.settings.SettingsGroup/addGroup

%   Copyright 2015-2019 The MathWorks, Inc.

    results = matlab.settings.internal.parseGroupPropertyValues(varargin);
    % parseSettingPropertyValues function parses and validates user-input for optional property-value pairs with inputParser.
    obj.removeGroupHelper(results.Name);
end
