FactorySetting
Factory settings object
Description
A FactorySetting
object represents an individual setting
within the factory settings tree.
Creation
Create FactorySetting
objects within the
FactoryGroup
root object using the addSetting
function. For
example:
myToolboxSettings = matlab.settings.FactoryGroup.createToolboxGroup('mytoolbox','Hidden',false); myFactorySetting = addSetting(myToolboxSettings,'MySetting','Hidden',false,'FactoryValue',10);
Properties
Name
— Name of factory setting
character vector | string
Name of factory setting, specified as a character vector or string.
Hidden
— Hidden state
true
(default) | false
Hidden state, specified as true
or
false
.
When set to true
, the factory setting does not display
in the Command Window or as part of tab completion, although it remains
accessible.
ReadOnly
— Read-only state
false
(default) | true
Read-only state, specified as true
or
false
. When true
, the personal or
temporary value of the setting cannot be specified.
FactoryValue
— Factory value of setting
MATLAB® data
Factory value of setting, 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. You must specify either a factory value or a factory value function for the setting, but not both.
FactoryValueFcn
— Function to set the setting factory value
function handle
Function to set the setting factory value, specified as a function handle. The factory value of the setting is set to the output of the specified function.
The function handle must point to a function on the MATLAB path. Anonymous or nested function handles are not supported.
You can specify either a factory value or a factory value function for the setting, but not both.
ValidationFcn
— Function to validate setting value
function handle
Function to validate a setting value, specified as a function handle. When specified, the function is used to validate the value of the factory setting.
The function handle must be associated with a function that accepts the potential setting value as an input argument, has no output arguments, and throws an error if the validation fails.
The function handle must point to a function on the MATLAB path. Anonymous or nested function handles are not supported.
Examples
Add New Factory Setting
Create the root factory group for the toolbox
mytoolbox
and then add a new setting to the tree.
Create the root factory group mytoolbox
.
myToolboxFactoryTree = matlab.settings.FactoryGroup.createToolboxGroup('mytoolbox', ... 'Hidden',false);
Add the setting FontSize
and give it a default value.
MATLAB returns the new setting as a FactorySetting
object.
fontSizeSetting = addSetting(myToolboxFactoryTree,'FontSize','FactoryValue',11,'Hidden',false);
Version History
Introduced in R2019b
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)