-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgetpref.m
More file actions
34 lines (31 loc) · 999 Bytes
/
getpref.m
File metadata and controls
34 lines (31 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function pref = getpref(preferenceName)
% getpref - Retrieve a specific user preference.
%
% Syntax:
% pref = openminds.getpref() returns an object representing the user
% preferences for the openMINDS Metadata Toolbox
%
% pref = openminds.getpref(preferenceName) Retrieves the value of the
% specified user preference from the Preferences.
%
% Input Arguments:
% preferenceName (1,1) string - The name of the preference to retrieve.
%
% Output Arguments:
% pref - The value of the specified preference.
arguments
preferenceName (1,1) string ...
{mustBeMember(preferenceName, ...
[ ...
"PropertyDisplayMode", ...
"DocLinkTarget", ...
"AddControlledInstanceToCollection", ...
"" ...
])...
} = ""
end
pref = openminds.utility.Preferences.getSingleton;
if preferenceName ~= ""
pref = pref.(preferenceName);
end
end