hasGroup - Determine if settings group exists - MATLAB (original) (raw)
Main Content
Determine if settings group exists
Syntax
Description
hasGroup([parentgroup](#mw%5F96edf730-a42e-4847-a2e0-79e79e7fc178),[name](#mw%5F499db798-057b-4dea-aa28-27256afa1509))
returns 1
if the settings group parentgroup
contains a settings group called name
. Otherwise,hasGroup
returns 0
.
Examples
Check whether a settings group exists before adding it.
Use the settings
function to access the root of the settings tree and then create the settings groupmysettings
.
s = settings; addGroup(s,'mysettings');
Check whether a settings group called myothersettings
exists before adding it to mysettings
.
if hasGroup(s.mysettings,'myothersettings') == 0 addGroup(s.mysettings,'myothersettings'); end s.mysettings
ans = SettingsGroup 'mysettings' with properties: myothersettings: [1×1 SettingsGroup]
Input Arguments
Parent settings group, 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 settings group to check for, specified as a character vector or string scalar.
Version History
Introduced in R2019b