-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPspecMenu.m
More file actions
103 lines (91 loc) · 2.72 KB
/
PspecMenu.m
File metadata and controls
103 lines (91 loc) · 2.72 KB
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
function [hFig,hAx] = PspecMenu(chid,csta,ii,Nwin);
% Usage: [hFig,hAx] = PspecMenu(chid,csta,ii,NcohBand);
% sets up multiple coherence menu + figure for plotting
[nchid,nt] = size(chid);
% stmonitr
if nt <=5
height_1 = 60;
elseif nt<=10
height_1 = 300/nt;
else
nt = 30
end
width = 200; height_1 = 50;
height = (nt+4)*height_1;
widthAll = width+(nt+2)*height_1;
loc = [700,300];
rect_fig = [loc widthAll height ];
hFig = figure('Position',rect_fig,...
'Tag','Coherence Figure',...
'UserData',ii);
k = 0;
rectN = [rect_fig(3) rect_fig(4) rect_fig(3) rect_fig(4)];
rect_1 = [ width*.15 (nt-k)*height_1+5 width*.75 height_1*.7];
rectN1 = rect_1./rectN;
uicontrol('style','text',...
'units','normalized',...
'position',rectN1,...
'string','CH/STA',...
'FontWeight','demi')
for k=1:nt
rect = [ width*.15 (nt-k)*height_1+5 width*.75 height_1*.8];
rect_2 = [ width*.65 (nt-k)*height_1+5 width*.125 height_1*.8];
rect_3 = [ width*.85 (nt-k)*height_1+5 width*.125 height_1*.8];
name = [csta(:,k)' ' ' chid(:,k)' ];
h1(k) = uicontrol('style','checkbox', ...
'parent',hFig,...
'units','normalized',...
'position',rect./rectN,...
'string',name,...
'FontWeight','demi',...
'value',0,...
'UserData',k,...
'tag','SpecCheckBox',...
'callback','PspecCB');
end % loop over channels 1:nt
rect = [ width*.1 (nt+2.6)*height_1+5 width*.8 height_1*.8];
h_plot = uicontrol('style','pushbutton', ...
'parent',hFig,...
'units','normalized',...
'position',rect./rectN,...
'string','PLOT',...
'FontWeight','demi',...
'Tag','SpecPlot',...
'callback','PspecCB');
rect = [ width (nt+2.6)*height_1+5 width*.8 height_1*.8];
h_plot = uicontrol('style','radiobutton', ...
'parent',hFig,...
'units','normalized',...
'position',rect./rectN,...
'string','Full TS',...
'FontWeight','demi',...
'Tag','FullTS',...
'Value',1,...
'callback','PspecCB');
rect = [ width*.1 (nt+1.5)*height_1+5 width*.4 height_1*.8];
h_NcB = uicontrol('style','text',...
'parent',hFig,...
'units','normalized',...
'position',rect./rectN,...
'string','# of Windows',...
'FontWeight','demi',...
'Tag','NBands text');
rect = [ width*.55 (nt+1.5)*height_1+5 width*.3 height_1*.8];
h_NcB = uicontrol('style','edit',...
'parent',hFig,...
'units','normalized',...
'position',rect./rectN,...
'string',num2str(Nwin),...
'FontWeight','demi',...
'Tag','Nwindows',...
'Callback','PspecCB');
set(gcf,'Name','Power Spectra');
rEdge = (rect_3(1)+rect_3(3))/rectN(1);
offset = .075;
w = 1-rEdge-1.5*offset;
rectPlotAx = [rEdge+offset .1 w .7];
hAx = axes('Position',rectPlotAx,...
'FontWeight','demi',...
'FontSize',12,...
'box','on', ...
'tag','R2 PLOT');