IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
uip_sgs_randsub_base.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file
3 %> @brief Properties Window for Random sub-sampling (@ref sgs_randsub_base)
4 %>
5 %> <b>Type</b> - see sgs_randsub_base::type
6 %>
7 %> <b>Bites (fractions)</b> - see sgs_randsub_base::bites
8 %>
9 %> <b>Bites (number of units)</b> - see sgs_randsub_base::bites_fixed
10 %>
11 %> <b>Number of repetitions</b> - see sgs_randsub_base::no_reps
12 %>
14 %
15 %> @cond
16 function varargout = uip_sgs_randsub_base(varargin)
17 % Last Modified by GUIDE v2.5 23-Feb-2012 18:55:28
18 
19 % Begin initialization code - DO NOT EDIT
20 gui_Singleton = 1;
21 gui_State = struct('gui_Name', mfilename, ...
22  'gui_Singleton', gui_Singleton, ...
23  'gui_OpeningFcn', @uip_sgs_randsub_base_OpeningFcn, ...
24  'gui_OutputFcn', @uip_sgs_randsub_base_OutputFcn, ...
25  'gui_LayoutFcn', [] , ...
26  'gui_Callback', []);
27 if nargin && ischar(varargin{1})
28  gui_State.gui_Callback = str2func(varargin{1});
29 end
30 
31 if nargout
32  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
33 else
34  gui_mainfcn(gui_State, varargin{:});
35 end
36 % End initialization code - DO NOT EDIT
37 
38 
39 % --- Executes just before uip_sgs_randsub_base is made visible.
40 function uip_sgs_randsub_base_OpeningFcn(hObject, eventdata, handles, varargin)
41 handles.output.flag_ok = 0;
42 guidata(hObject, handles);
43 gui_set_position(hObject);
44 
45 % --- Outputs from this function are returned to the command clae.
46 function varargout = uip_sgs_randsub_base_OutputFcn(hObject, eventdata, handles)
47 try
48  uiwait(handles.figure1);
49  handles = guidata(hObject);
50  varargout{1} = handles.output;
51  delete(gcf);
52 catch
53  output.flag_ok = 0;
54  output.params = {};
55  varargout{1} = output;
56 end;
57 
58 % --- Executes on button press in pushbuttonOk.
59 function pushbuttonOk_Callback(hObject, eventdata, handles)
60 try
61  other = uip_sgs();
62  if other.flag_ok
63  types = get(handles.popupmenu_type, 'String');
64  handles.output.params = [other.params, {...
65  'type', ['''', types{get(handles.popupmenu_type, 'Value')}, ''''], ...
66  'bites', mat2str(eval(get(handles.edit_bites, 'String'))), ...
67  'bites_fixed', mat2str(eval(get(handles.edit_bites_fixed, 'String'))), ...
68  'no_reps', num2str(eval(get(handles.edit_no_reps, 'String'))) ...
69  }];
70  handles.output.flag_ok = 1;
71  guidata(hObject, handles);
72  uiresume();
73  end;
74 catch ME
75  irerrordlg(ME.message, 'Cannot continue');
76 
77 end;
78 
79 % --- Executes on button press in checkbox_flag_loo.
80 function checkbox_flag_loo_Callback(hObject, eventdata, handles)
81 
82 function edit_bites_Callback(hObject, eventdata, handles)
83 
84 % --- Executes during object creation, after setting all properties.
85 function edit_bites_CreateFcn(hObject, eventdata, handles)
86 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
87  set(hObject,'BackgroundColor','white');
88 end
89 
90 % --- Executes on selection change in popupmenu_type.
91 function popupmenu_type_Callback(hObject, eventdata, handles)
92 
93 % --- Executes during object creation, after setting all properties.
94 function popupmenu_type_CreateFcn(hObject, eventdata, handles)
95 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
96  set(hObject,'BackgroundColor','white');
97 end
98 
99 function edit_bites_fixed_Callback(hObject, eventdata, handles)
100 
101 % --- Executes during object creation, after setting all properties.
102 function edit_bites_fixed_CreateFcn(hObject, eventdata, handles)
103 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
104  set(hObject,'BackgroundColor','white');
105 end
106 
107 function edit_no_reps_Callback(hObject, eventdata, handles)
108 
109 % --- Executes during object creation, after setting all properties.
110 function edit_no_reps_CreateFcn(hObject, eventdata, handles)
111 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
112  set(hObject,'BackgroundColor','white');
113 end
114 %> @endcond
Base Sub-dataset Generation Specification (SGS) class.
Definition: sgs.m:6
Random Sub-sampling base class.
Property no_reps
=10. The number of repetitions.
Property bites
=[.9, .1]: vectors of percentages.
Property bites_fixed
Used only if type is 'fixed', otherwise bites will be used.
Random Sub-sampling.
Definition: sgs_randsub.m:5
function gui_set_position(in hObject)
function irerrordlg(in errorstring, in dlgname)