time | Calls | line |
---|
| | 1 | function rootgroup = settings()
|
| | 2 | % SETTINGS Access the SettingsGroup root object.
|
| | 3 | %
|
| | 4 | % SETTINGS returns the root SettingsGroup object in the settings
|
| | 5 | % hierarchical tree
|
| | 6 | %
|
| | 7 | % Example
|
| | 8 | % Assume the settings tree contains these SettingsGroup and Setting objects:
|
| | 9 | %
|
| | 10 | % root
|
| | 11 | % / \
|
| | 12 | % matlab mytoolbox
|
| | 13 | % / / \
|
| | 14 | % ... FontSize MainWindow
|
| | 15 | %
|
| | 16 | % Use the SETTINGS function to access the root SettingsGroup object.
|
| | 17 | % >> S = settings;
|
| | 18 | %
|
| | 19 | % Then, access the desired Setting object in the settings tree.
|
| | 20 | % For example,
|
| | 21 | % >> S.mytoolbox.FontSize
|
| | 22 | %
|
| | 23 | % ans =
|
| | 24 | % Setting 'mytoolbox.FontSize' with properties:
|
| | 25 | %
|
| | 26 | % ActiveValue: 12
|
| | 27 | % TemporaryValue: 12
|
| | 28 | % PersonalValue: <no value>
|
| | 29 | % FactoryValue: 10
|
| | 30 | %
|
| | 31 | %
|
| | 32 | % See also matlab.settings.Setting, matlab.settings.SettingsGroup
|
| | 33 |
|
| | 34 | % Copyright 2014-2018 The MathWorks, Inc.
|
| | 35 |
|
< 0.001 | 22 | 36 | minargs = 0;
|
< 0.001 | 22 | 37 | maxargs = 0;
|
< 0.001 | 22 | 38 | narginchk(minargs, maxargs);
|
| | 39 |
|
< 0.001 | 22 | 40 | persistent settingsgroup;
|
| | 41 |
|
< 0.001 | 22 | 42 | if isempty(settingsgroup)
|
| | 43 | settingsgroup = matlab.settings.SettingsGroup();
|
< 0.001 | 22 | 44 | end
|
< 0.001 | 22 | 45 | rootgroup = settingsgroup;
|
< 0.001 | 22 | 46 | end
|
Other subfunctions in this file are not included in this listing.