IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
uip_frbm.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file
3 %> @brief Properties Window for Fuzzy Rule-Based Model (@ref frbm)
4 %>
5 %> @image html Screenshot-uip_frbm.png
6 %>
7 %> <b>Multiple logical targets</b>: frbm::flag_class2mo
8 %>
9 %> <b>Scale</b>: frbm::scale
10 %>
11 %> <b>Epsilon</b>: frbm::epsilon
12 %>
13 %> <b>Use Input/output space</b>: frbm::flag_iospace
14 %>
15 %> <b>Clone closest rule radius at new rule</b>: frbm::flag_clone_rule_radii
16 %>
17 %> <b>Add Ps < Pmin to condition...</b>: frbm::flag_consider_Pmin
18 %>
19 %> <b>Rule updating function</b>: frbm::s_f_update_rules
20 %>
21 %> <b>Group rules per class</b>: frbm::flag_perclass
22 %>
23 %> <b>Firing level calculator</b>: frbm::s_f_get_firing
24 %>
25 %> <b>Takagi-Sugeno order</b>: frbm::ts_order
26 %>
27 %> <b>Defuzzification</b>: frbm::flag_wta
28 %>
29 %> <b>Global RLS</b>: frbm::flag_rls_global
30 %>
31 %> @sa frbm
32 
33 %> @cond
34 function varargout = uip_frbm(varargin)
35 % Last Modified by GUIDE v2.5 19-Mar-2011 22:55:31
36 
37 % Begin initialization code - DO NOT EDIT
38 gui_Singleton = 1;
39 gui_State = struct('gui_Name', mfilename, ...
40  'gui_Singleton', gui_Singleton, ...
41  'gui_OpeningFcn', @uip_frbm_OpeningFcn, ...
42  'gui_OutputFcn', @uip_frbm_OutputFcn, ...
43  'gui_LayoutFcn', [] , ...
44  'gui_Callback', []);
45 if nargin && ischar(varargin{1})
46  gui_State.gui_Callback = str2func(varargin{1});
47 end
48 
49 if nargout
50  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
51 else
52  gui_mainfcn(gui_State, varargin{:});
53 end
54 % End initialization code - DO NOT EDIT
55 
56 
57 % --- Executes just before uip_frbm is made visible.
58 function uip_frbm_OpeningFcn(hObject, eventdata, handles, varargin)
59 handles.output.flag_ok = 0;
60 guidata(hObject, handles);
61 gui_set_position(hObject);
62 
63 
64 
65 % --- Outputs from this function are returned to the command line.
66 function varargout = uip_frbm_OutputFcn(hObject, eventdata, handles)
67 try
68  uiwait(handles.figure1);
69  handles = guidata(hObject);
70  varargout{1} = handles.output;
71  delete(gcf);
72 catch
73  output.flag_ok = 0;
74  varargout{1} = output;
75 end;
76 
77 
78 function pushbuttonCreateFRBM_Callback(hObject, eventdata, handles)
79 
80 try
81 % 'f_train', sprintf('@%s', fel(get(handles.popupmenuFTrain, 'String'))), ...
82 % 'max_rules_per_group', sprintf('%d', eval(get(handles.editMaxR, 'String'))), ...
83 % 's_script_support_rule', sprintf('''%s''', fel(get(handles.popupmenu_f_support_rule, 'String'), get(handles.popupmenu_f_support_rule, 'Value'))), ...
84  handles.output.params = {...
85  'scale', get(handles.editScale, 'String'), ...
86  'epsilon', get(handles.editEpsilon, 'String'), ...
87  'flag_consider_Pmin', sprintf('%d', get(handles.checkboxConPMin, 'Value') ~= 0), ...
88  'flag_perclass', sprintf('%d', get(handles.checkboxPerClass, 'Value') ~= 0), ...
89  'flag_clone_rule_radii', sprintf('%d', get(handles.checkboxCloneRadius, 'Value') ~= 0), ...
90  'flag_iospace', sprintf('%d', get(handles.checkboxIOSpace, 'Value') ~= 0), ...
91  's_f_get_firing', sprintf('''%s''', fel(get(handles.popupmenuFiring, 'String'), get(handles.popupmenuFiring, 'Value'))), ...
92  's_f_update_rules', sprintf('''%s''', fel(get(handles.popupmenuFRuleUpdate, 'String'), get(handles.popupmenuFRuleUpdate, 'Value'))), ...
93  'flag_rls_global', sprintf('%d', get(handles.checkbox_flag_rls_global, 'Value') ~= 0), ...
94  'rho', mat2str(eval(get(handles.editRho, 'String'))), ...
95  'ts_order', sprintf('%d', get(handles.popupmenuTSOrder, 'Value')-1), ...
96  'flag_wta', sprintf('%d', get(handles.popupmenuDefuzzification, 'Value') ~= 1) ...
97  'flag_class2mo', sprintf('%d', get(handles.checkboxFlagClass2MO, 'Value') ~= 0)...
98  };
99  % 'flag_b_classic', sprintf('%d', get(handles.checkboxBClassic, 'Value') ~= 0), ...
100  % 'new_rule_factor', mat2str(eval(get(handles.editNewRuleFactor, 'String'))), ...
101  handles.output.flag_ok = 1;
102  guidata(hObject, handles);
103  uiresume();
104 catch ME
105  irerrordlg(ME.message, 'Cannot continue');
106 
107 end;
108 
109 function popupmenuFiring_Callback(hObject, eventdata, handles)
110 
111 function popupmenuFiring_CreateFcn(hObject, eventdata, handles)
112 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
113  set(hObject,'BackgroundColor','white');
114 end
115 
116 function checkboxConPMin_Callback(hObject, eventdata, handles)
117 
118 function popupmenuFRuleUpdate_Callback(hObject, eventdata, handles)
119 
120 function popupmenuFRuleUpdate_CreateFcn(hObject, eventdata, handles)
121 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
122  set(hObject,'BackgroundColor','white');
123 end
124 
125 function editMaxR_Callback(hObject, eventdata, handles)
126 
127 function editMaxR_CreateFcn(hObject, eventdata, handles)
128 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
129  set(hObject,'BackgroundColor','white');
130 end
131 
132 function popupmenuFTrain_Callback(hObject, eventdata, handles)
133 
134 function popupmenuFTrain_CreateFcn(hObject, eventdata, handles)
135 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
136  set(hObject,'BackgroundColor','white');
137 end
138 
139 function popupmenuRuleGrouping_Callback(hObject, eventdata, handles)
140 
141 function popupmenuRuleGrouping_CreateFcn(hObject, eventdata, handles)
142 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
143  set(hObject,'BackgroundColor','white');
144 end
145 
146 function editScale_Callback(hObject, eventdata, handles)
147 
148 function editScale_CreateFcn(hObject, eventdata, handles)
149 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
150  set(hObject,'BackgroundColor','white');
151 end
152 
153 function editEpsilon_Callback(hObject, eventdata, handles)
154 
155 function editEpsilon_CreateFcn(hObject, eventdata, handles)
156 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
157  set(hObject,'BackgroundColor','white');
158 end
159 
160 function popupmenuTSOrder_Callback(hObject, eventdata, handles)
161 
162 function popupmenuTSOrder_CreateFcn(hObject, eventdata, handles)
163 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
164  set(hObject,'BackgroundColor','white');
165 end
166 
167 function editRho_Callback(hObject, eventdata, handles)
168 
169 function editRho_CreateFcn(hObject, eventdata, handles)
170 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
171  set(hObject,'BackgroundColor','white');
172 end
173 
174 function checkboxIOSpace_Callback(hObject, eventdata, handles)
175 
176 function checkboxPerClass_Callback(hObject, eventdata, handles)
177 
178 function checkboxCloneRadius_Callback(hObject, eventdata, handles)
179 
180 function popupmenuRLSOverall_Callback(hObject, eventdata, handles)
181 
182 function popupmenuRLSOverall_CreateFcn(hObject, eventdata, handles)
183 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
184  set(hObject,'BackgroundColor','white');
185 end
186 
187 function popupmenuDefuzzification_Callback(hObject, eventdata, handles)
188 
189 function popupmenuDefuzzification_CreateFcn(hObject, eventdata, handles)
190 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
191  set(hObject,'BackgroundColor','white');
192 end
193 
194 
195 % --- Executes on selection change in popupmenuFDD.
196 function popupmenuFDD_Callback(hObject, eventdata, handles)
197 
198 % --- Executes during object creation, after setting all properties.
199 function popupmenuFDD_CreateFcn(hObject, eventdata, handles)
200 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
201  set(hObject,'BackgroundColor','white');
202 end
203 
204 
205 % --- Executes on button press in checkboxBClassic.
206 function checkboxBClassic_Callback(hObject, eventdata, handles)
207 
208 function editNewRuleFactor_Callback(hObject, eventdata, handles)
209 
210 % --- Executes during object creation, after setting all properties.
211 function editNewRuleFactor_CreateFcn(hObject, eventdata, handles)
212 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
213  set(hObject,'BackgroundColor','white');
214 end
215 
216 % --- Executes on button press in checkboxFlagClass2MO.
217 function checkboxFlagClass2MO_Callback(hObject, eventdata, handles)
218 
219 
220 % --- Executes on selection change in popupmenu_f_support_rule.
221 function popupmenu_f_support_rule_Callback(hObject, eventdata, handles)
222 
223 % --- Executes during object creation, after setting all properties.
224 function popupmenu_f_support_rule_CreateFcn(hObject, eventdata, handles)
225 
226 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
227  set(hObject,'BackgroundColor','white');
228 end
229 
230 % --- Executes on button press in checkbox_flag_rls_global.
231 function checkbox_flag_rls_global_Callback(hObject, eventdata, handles)
232 %>@endcond
function fel(in c, in n)
function gui_set_position(in hObject)
function irerrordlg(in errorstring, in dlgname)