hasFactoryValue

Tests whether a setting has a factory value.

Category: Environment and Settings > System Commands

Syntax

tf = hasFactoryValue(S)

Returns true when the factory layer of setting S holds a value.

Description

A setting can hold a temporary, personal, installation and factory value at the same time, and ActiveValue shows the first one set in that order. hasFactoryValue looks at one layer only, so it tells whether that layer would take part in the lookup. Settings created with addSetting never have a factory value; only product settings do.

Input arguments

S
A matlab.settings.Setting object.

Output arguments

tf
Logical scalar: true if the factory value is set.

Example

Query the factory layer

s = settings;
g = addGroup(s, 'demo');
a = addSetting(g, 'Level', 'PersonalValue', 1);
disp(hasFactoryValue(a))
removeGroup(s, 'demo');
Output
   0

See also

hasInstallationValue hasPersonalValue addSetting settings