-
Notifications
You must be signed in to change notification settings - Fork 0
/
find_stim_ch.m
40 lines (40 loc) · 1.6 KB
/
find_stim_ch.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
load('SEC_DataStructure.mat');
stim_ch = [];
[idxA,~] = listdlg('PromptString','Select animal(s):','ListString',{DataStructure.AnimalName});
[idxD,~] = listdlg('PromptString','Select day(s):','ListString',DataStructure(idxA).DateStr);
for i = [3] % set as the runs you want to check
curFileName = [DataStructure(idxA).AnimalName '_' ...
DataStructure(idxA).DateStr{idxD} '_' ...
num2str(DataStructure(idxA).Run{idxD}(i))];
for ii = 1:64
if ii < 33
nii = ii - 1;
aCh = cell2mat(compose('%03d',nii));
load(fullfile(DataStructure(idxA).NetworkPath,DataStructure(idxA).AnimalName,...
curFileName,...
[curFileName '_Digital'],...
'STIM_DATA',...
[curFileName '_STIM_P1_Ch_' aCh '.mat']));
disp(['P1_Ch_' aCh])
if range(data) > 0
disp('Found!')
add = string(sprintf('P1 %s',aCh));
stim_ch = [stim_ch add];
end
else
nii = ii - 33;
aCh = cell2mat(compose('%03d',nii));
load(fullfile(DataStructure(idxA).NetworkPath,DataStructure(idxA).AnimalName,...
curFileName,...
[curFileName '_Digital'],...
'STIM_DATA',...
[curFileName '_STIM_P2_Ch_' aCh '.mat']));
disp(['P2_Ch_' aCh])
if range(data) > 0
disp('Found!')
add = string(sprintf('P2 %s',aCh));
stim_ch = [stim_ch add];
end
end
end
end