hasTemporaryValue

Tests whether a setting has a temporary value.

Category: Environment and Settings > System Commands

Syntax

tf = hasTemporaryValue(S)

Returns true when the temporary 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. hasTemporaryValue looks at one layer only, so it tells whether that layer would take part in the lookup.

Input arguments

S
A matlab.settings.Setting object.

Output arguments

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

Example

Query the temporary layer

s = settings;
g = addGroup(s, 'demo');
a = addSetting(g, 'Level');
disp(hasTemporaryValue(a))
a.TemporaryValue = 5;
disp(hasTemporaryValue(a))
removeGroup(s, 'demo');
Output
   0
   1

See also

clearTemporaryValue hasPersonalValue addSetting settings