-
Notifications
You must be signed in to change notification settings - Fork 5
/
subSetValues.m
27 lines (26 loc) · 993 Bytes
/
subSetValues.m
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
function B = subSetValues(B,val)
% set values for buttons, editable fields and other GUI input fields
% called from MITT and ClassifyArrayGUI
% modified May 25 2016 to work with setARMAopts by BM
Bname = subFieldnames(val);
%set display filter parameters from BC
nBtot = length(Bname);
% get faQC parameters from figure
for nB = 1:nBtot
Bnamei = Bname{nB};
if isfield(B,Bnamei);
eval(['Bstyle = get(B.',Bname{nB},',''Style'');']);
switch Bstyle
case 'edit'
eval(['set(B.',Bnamei,',''String'',num2str(val.',Bnamei,'));']);
case 'text'
eval(['set(B.',Bnamei,',''String'',val.',Bnamei,'));']);
case 'checkbox'
eval(['set(B.',Bnamei,',''Value'',val.',Bnamei,');']);
case 'listbox'
eval(['set(B.',Bnamei,',''Value'',val.',Bnamei,');']);
case 'popupmenu'
eval(['set(B.',Bnamei,',''Value'',val.',Bnamei,');']);
end
end
end