Setting
Represents individual setting
Description
A Setting
object represents an individual setting within the
settings hierarchical tree.
Creation
Access individual Setting
objects using the root SettingsGroup
object returned by the settings
function. For example, this code accesses the MaxWidth
setting.
s = settings s.matlab.editor.language.matlab.comments.MaxWidth
Properties
ActiveValue
— Current or active setting value
MATLAB® data
Current or active setting value, specified as MATLAB data of any type except for handle types. Data containers such as cell arrays, structs, and objects that include handles are also not supported.
The active value is determined as follows:
If the setting has a temporary value, then the active value is the temporary value.
If the setting has no temporary value, but it has a personal value, then the active value is the personal value.
If the setting has no temporary or personal value, but it has an installation value, then the active value is the installation value.
If the setting has no temporary, personal, or installation value, then the active value is the factory value.
For example, suppose you have a setting MySetting
with
these values:
Temporary value: 12
Personal value: no value
Installation value: no value
Factory value: 10
In this case, the active value for MySetting
is the
temporary value, 12
.
TemporaryValue
— Temporary setting value
MATLAB data
Temporary setting value, specified as MATLAB data of any type except for handle types. Data containers such as cell arrays, structs, and objects that include handles are also not supported.
The temporary value is available only for the current MATLAB session and is cleared at the end of the session.
Some settings are linked to a preference. If a setting is linked to a preference, changing the temporary value for a setting temporarily changes the corresponding preference. At the end of the MATLAB session, the preference reverts to its original value. For more information about preferences, see Preferences.
PersonalValue
— Personal setting value
MATLAB data
Personal setting value, specified as MATLAB data of any type except for handle types. Data containers such as cell arrays, structs, and objects that include handles are also not supported.
The personal value is persistent across MATLAB sessions for an individual user. When modified, the value is saved to the preferences folder.
Some settings are linked to a preference. If a setting is linked to a preference, changing the personal value for the setting changes the corresponding preference as well. For more information about preferences, see Preferences.
InstallationValue
— Installation setting value
MATLAB data
Installation setting value, specified as MATLAB data of any type except for handle types. Data containers such as cell arrays, structs, and objects that include handles are also not supported.
The installation value is available from a given MATLAB installation. When modified, the value is saved to the MATLAB root. The value persists across sessions, but it does not migrate during upgrades to new versions of MATLAB.
Some settings are linked to a preference. If a setting is linked to a preference and changing the installation value changes the active value, the setting changes the corresponding preference as well. For more information about preferences, see Preferences.
FactoryValue
— Factory setting value
MATLAB data
This property is read-only.
Factory setting value, specified as MATLAB data of any type except for handle types. Data containers such as cell arrays, structs, and objects that include handles are also not supported.
The factory value is the default product setting. It is not modifiable. In addition, you cannot specify the factory value for a custom setting.
Object Functions
clearTemporaryValue | Clear temporary value for setting |
clearPersonalValue | Clear personal value for setting |
clearInstallationValue | Clear installation value for setting |
hasTemporaryValue | Determine whether setting has temporary value set |
hasPersonalValue | Determine whether setting has personal value set |
hasInstallationValue | Determine whether setting has installation value set |
hasFactoryValue | Determine whether setting has factory value set |
Examples
View All the Values of a Setting
View the current values for the maximum column width for comments in the Editor.
s = settings; s.matlab.editor.language.matlab.comments.MaxWidth
ans = Setting 'matlab.editor.language.matlab.comments.MaxWidth' with properties. ActiveValue: 80 TemporaryValue: 80 PersonalValue: <no value> InstallationValue: <no value> FactoryValue: 75
Access and Modify a Setting
Get and set the value for the maximum column width for comments in MATLAB.
Get the root SettingsGroup
object and view the active
value for the maximum column width for comments in MATLAB.
s = settings; s.matlab.editor.language.matlab.comments.MaxWidth.ActiveValue
ans = int32 75
Set the temporary value for the maximum column width for comments in MATLAB.
s.matlab.editor.language.matlab.comments.MaxWidth.TemporaryValue = 80; s.matlab.editor.language.matlab.comments.MaxWidth.ActiveValue
ans = int32 80
Version History
Introduced in R2018a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)