/
CNAQ.m
620 lines (477 loc) · 24.6 KB
/
CNAQ.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
function varargout = CNAQ(varargin)
% CNAQ M-file for CNAQ.fig
%
% Copyright (c) 2007-2008 Guillaume Pellerin <guillaume.pellerin@cnam.fr>
% All rights reserved.
% This software is governed by the CeCILL license under French law and
% abiding by the rules of distribution of free software. You can use,
% modify and/ or redistribute the software under the terms of the CeCILL
% license as circulated by CEA, CNRS and INRIA at the following URL
% "http://www.cecill.info".
%
% As a counterpart to the access to the source code and rights to copy,
% modify and redistribute granted by the license, users are provided only
% with a limited warranty and the software's author, the holder of the
% economic rights, and the successive licensors have only limited
% liability.
%
% In this respect, the user's attention is drawn to the risks associated
% with loading, using, modifying and/or developing or reproducing the
% software by the user in light of its specific status of free software,
% that may mean that it is complicated to manipulate, and that also
% therefore means that it is reserved for developers and experienced
% professionals having in-depth computer knowledge. Users are therefore
% encouraged to load and test the software's suitability as regards their
% requirements in conditions enabling the security of their systems and/or
% data to be ensured and, more generally, to use and operate it in the
% same conditions as regards security.
%
% The fact that you are presently reading this means that you have had
% knowledge of the CeCILL license given in the file COPYING and
% that you accept its terms. The terms are also available at
% http://svn.parisson.org/cnaq/wiki/CnaqLicense.
% Author: Guillaume Pellerin <guillaume.pellerin@cnam.fr>
% Last Modified by GUIDE v2.5 21-Nov-2008 11:36:46
% CNAQ, by itself, creates a new CNAQ or raises the existing
% singleton*.
%
% H = CNAQ returns the handle to a new CNAQ or the handle to
% the existing singleton*.
%
% CNAQ('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CNAQ.M with the given input arguments.
%
% CNAQ('Property','Value',...) creates a new CNAQ or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before CNAQ_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to CNAQ_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Global variables
% ==============================================================
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @CNAQ_OpeningFcn, ...
'gui_OutputFcn', @CNAQ_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
%global out_button_value in_button_value gen_button_value mes_button_value f_s n_bits;
% --- Executes just before CNAQ is made visible.
function CNAQ_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to CNAQ (see VARARGIN)
% Choose default command line output for CNAQ
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% --- Outputs from this function are returned to the command line.
function varargout = CNAQ_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% UIWAIT makes CNAQ wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% ==============================================================
% ==============================================================
% INIT
% ==============================================================
root_dir = pwd; % The directory where CNAQ is installed
cnaq_path = root_dir;
config_path = [cnaq_path filesep 'config' filesep];
tools_path = [cnaq_path filesep 'tools' filesep];
pa_path = [cnaq_path filesep 'lib' filesep 'pa_wavplay' filesep];
path(path, cnaq_path);
path(path, tools_path);
path(path, pa_path);
path(path, config_path);
cnaq_version = get_version();
% Get audio device parameters
[device, latency] = asio();
% Get home directory
home_dir = uigetdir(root_dir, 'Choose your workspace');
% Get/Set ID
set(handles.home_dir_box,'String',home_dir);
id = get_id(handles);
set(handles.ID,'String',id);
set(handles.info1_text,'String',['CNAQ v' cnaq_version ' - Copyright (C) 2007-2008']);
set(handles.info2_text,'String','Guillaume Pellerin, Manuel Melon CNAM Paris http://svn.parisson.org/cnaq/');
% Set default values
set(handles.f_gen_min,'String','20');
set(handles.f_gen_max,'String','20000');
set(handles.f_gen,'Value',1000);
set(handles.f_gen,'Min',20);
set(handles.f_gen,'Max',20000);
set(handles.freq_value,'String','1000')
set(handles.gain_in,'Value',-6.0);
set(handles.gain_in_value,'String','-6.0');
set(handles.gain_out,'Value',-6.0);
set(handles.gain_out_value,'String','-6.0');
set(handles.time_gen_min,'String','1');
set(handles.time_gen_max,'String','20');
set(handles.time_gen,'Value',5);
set(handles.time_gen,'Min',1);
set(handles.time_gen,'Max',20);
set(handles.time_value,'String','5')
set(handles.nbits,'String','16|24');
set(handles.f_s,'String','44100|48000|88200|96000|192000');
%set(handles.out_on_off,'Value',0);
set(handles.in_on_off,'Value',0);
set(handles.gen_on_off,'Value',0);
set(handles.sig_type,'String','Sinus|Chirp|White noise|Pink noise');
set(handles.channels_in,'String','1|1 2|1 2 3|1 2 3 4|1 2 3 4 5 6 7 8');
set(handles.channels_out,'String','1|1 2|1 2 3|1 2 3 4|1 2 3 4 5 6 7 8');
set(handles.analysis_type,'String','Transfer function|Impedance');
set(handles.analysis_method,'String','Division|Deconvolution');
set(handles.analysis_domain,'String','Frequency|Time|Time/Frequency');
set(handles.in_on_off,'UserData',device);
set(handles.save_button,'UserData',latency);
set(handles.analysis_input_sig,'String','Generated|Measured');
set(handles.analysis_output_sig,'String','Measured|Generated');
set(handles.analysis_input_ch,'String','1|2|3|4|5|6|7|8');
set(handles.analysis_output_ch,'String','1|2|3|4|5|6|7|8');
%============================================
% DATA
%============================================
function username_Callback(hObject, eventdata, handles)
% hObject handle to username (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of username as text
% str2double(get(hObject,'String')) returns contents of username as a double
% --- Executes during object creation, after setting all properties.
function username_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function comment_Callback(hObject, eventdata, handles)
function comment_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function f_s_Callback(hObject, eventdata, handles)
function f_s_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function nbits_Callback(hObject, eventdata, handles)
function nbits_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function get_home_dir_Callback(hObject, eventdata, handles)
home_dir = uigetdir;
set(handles.home_dir_box,'String',home_dir);
id = get_id(handles);
set(handles.ID,'String',id);
%============================================
% MONITOR
%============================================
function in_on_off_Callback(hObject, eventdata, handles)
monitor(handles)
%============================================
% VOICES
%============================================
function gain_in_Callback(hObject, eventdata, handles)
set(handles.gain_in_value,'String',num2str(get(handles.gain_in,'Value')));
function gain_in_CreateFcn(hObject, eventdata, handles)
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
function gain_out_Callback(hObject, eventdata, handles)
set(handles.gain_out_value,'String',num2str(get(handles.gain_out,'Value')))
function gain_out_CreateFcn(hObject, eventdata, handles)
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
function channels_in_Callback(hObject, eventdata, handles)
function channels_in_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function channels_out_Callback(hObject, eventdata, handles)
function channels_out_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
%============================================
% GENERATOR
%============================================
function sig_type_Callback(hObject, eventdata, handles)
function sig_type_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% TIME
function time_gen_min_Callback(hObject, eventdata, handles)
tg_min = str2double(get(handles.time_gen_min,'String'));
tg_value = get(handles.time_gen,'Value');
if tg_min > tg_value
set(handles.time_gen,'String',num2str(tg_min));
end
set(handles.time_gen,'Min',tg_min);
function time_gen_min_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function time_gen_max_Callback(hObject, eventdata, handles)
tg_max = str2double(get(handles.time_gen_max,'String'));
tg_value = get(handles.time_gen,'Value');
if tg_max < tg_value
set(handles.time_gen,'String',num2str(tg_max));
end
set(handles.time_gen,'Max',tg_max);
function time_gen_max_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function time_gen_Callback(hObject, eventdata, handles)
set(handles.time_value,'String',num2str(get(handles.time_gen,'Value')))
function time_gen_CreateFcn(hObject, eventdata, handles)
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
% FREQ
function f_gen_max_Callback(hObject, eventdata, handles)
fg_max = str2double(get(handles.f_gen_max,'String'));
fg_value = get(handles.f_gen,'Value');
if fg_max < fg_value
set(handles.f_gen,'String',num2str(fg_max));
end
set(handles.f_gen,'Max',fg_max);
function f_gen_max_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function f_gen_min_Callback(hObject, eventdata, handles)
fg_min = str2double(get(handles.f_gen_min,'String'));
fg_value = get(handles.f_gen,'Value');
if fg_min > fg_value
set(handles.f_gen,'String',num2str(fg_min));
end
set(handles.f_gen,'Min',fg_min);
function f_gen_min_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function f_gen_Callback(hObject, eventdata, handles)
set(handles.freq_value,'String',num2str(get(handles.f_gen,'Value')));
function f_gen_CreateFcn(hObject, eventdata, handles)
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
function gen_on_off_Callback(hObject, eventdata, handles)
% Hint: get(hObject,'Value') returns toggle state of gen_on_off
generator(handles)
%============================================
% MEASUREMENT
%============================================
function analysis_method_Callback(hObject, eventdata, handles)
function analysis_method_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function mes_on_Callback(hObject, eventdata, handles, device)
measurement(handles)
plot_main(handles)
% Close all figures
% --- Executes on button press in close_button.
function close_button_Callback(hObject, eventdata, handles)
% hObject handle to close_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close all;
% --- Executes on button press in plot.
function plot_Callback(hObject, eventdata, handles)
% hObject handle to plot (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
plot_main(handles);
% SAVE all data in a mat file
function save_button_Callback(hObject, eventdata, handles)
home_dir = get(handles.home_dir_box,'String');
cd(home_dir);
save_mes(handles);
% --- Executes on button press in load.
function load_Callback(hObject, eventdata, handless)
% hObject handle to load (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename, pathname, filterindex] = uigetfile('*.mat', 'Pick a saved MAT file');
load([pathname filename]);
% Set data
set(handless.username,'String',username);
set(handless.home_dir_box,'String',home_dir);
set(handless.comment,'String',comment);
set(handless.id_title,'UserData',sig_exc);
set(handless.ID,'UserData',sig_mes);
set(handless.mes_on,'UserData',f_log);
set(handless.close_button,'UserData',f_lin);
set(handless.mes_on,'UserData', f);
set(handless.plot,'UserData', t);
% set(handles.f_gen_min,'String', num2str(f_min));
% set(handles.f_gen_max,'String', num2str(f_max));
% set(handles.f_gen,'Value', f);
% set(handles.freq_value,'String',num2str(f));
% set(handles.time_gen,'Value', time);
% set(handles.time_value,'String',num2str(time));
% set(handles.gain_in,'Value', gain_in);
% set(handles.gain_out,'Value', gain_out);
% set(handles.gain_in_value,'String',num2str(gain_in));
% set(handles.gain_out_value,'String',num2str(gain_out));
% set(handles.freq_value,'String',num2str(f));
% set(handles.time_value,'String',num2str(time));
% --- Executes on selection change in analysis_type.
function analysis_type_Callback(hObject, eventdata, handles)
% hObject handle to analysis_type (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns analysis_type contents as cell array
% contents{get(hObject,'Value')} returns selected item from analysis_type
% --- Executes during object creation, after setting all properties.
function analysis_type_CreateFcn(hObject, eventdata, handles)
% hObject handle to analysis_type (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in analysis_domain.
function analysis_domain_Callback(hObject, eventdata, handles)
% hObject handle to analysis_domain (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns analysis_domain contents as cell array
% contents{get(hObject,'Value')} returns selected item from analysis_domain
% --- Executes during object creation, after setting all properties.
function analysis_domain_CreateFcn(hObject, eventdata, handles)
% hObject handle to analysis_domain (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function r_c_Callback(hObject, eventdata, handles)
% hObject handle to r_c (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of r_c as text
% str2double(get(hObject,'String')) returns contents of r_c as a double
% --- Executes during object creation, after setting all properties.
function r_c_CreateFcn(hObject, eventdata, handles)
% hObject handle to r_c (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in analysis_output_sig.
function analysis_output_sig_Callback(hObject, eventdata, handles)
% hObject handle to analysis_output_sig (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns analysis_output_sig contents as cell array
% contents{get(hObject,'Value')} returns selected item from analysis_output_sig
% --- Executes during object creation, after setting all properties.
function analysis_output_sig_CreateFcn(hObject, eventdata, handles)
% hObject handle to analysis_output_sig (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in analysis_output_ch.
function analysis_output_ch_Callback(hObject, eventdata, handles)
% hObject handle to analysis_output_ch (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns analysis_output_ch contents as cell array
% contents{get(hObject,'Value')} returns selected item from analysis_output_ch
% --- Executes during object creation, after setting all properties.
function analysis_output_ch_CreateFcn(hObject, eventdata, handles)
% hObject handle to analysis_output_ch (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in analysis_input_sig.
function analysis_input_sig_Callback(hObject, eventdata, handles)
% hObject handle to analysis_input_sig (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns analysis_input_sig contents as cell array
% contents{get(hObject,'Value')} returns selected item from analysis_input_sig
% --- Executes during object creation, after setting all properties.
function analysis_input_sig_CreateFcn(hObject, eventdata, handles)
% hObject handle to analysis_input_sig (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in analysis_input_ch.
function analysis_input_ch_Callback(hObject, eventdata, handles)
% hObject handle to analysis_input_ch (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns analysis_input_ch contents as cell array
% contents{get(hObject,'Value')} returns selected item from analysis_input_ch
% --- Executes during object creation, after setting all properties.
function analysis_input_ch_CreateFcn(hObject, eventdata, handles)
% hObject handle to analysis_input_ch (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function r_c_Callback(hObject, eventdata, handles)
% hObject handle to r_c (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of r_c as text
% str2double(get(hObject,'String')) returns contents of r_c as a double
% --- Executes during object creation, after setting all properties.
function r_c_CreateFcn(hObject, eventdata, handles)
% hObject handle to r_c (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end