-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataGen_refblk.m
More file actions
29 lines (25 loc) · 1.2 KB
/
dataGen_refblk.m
File metadata and controls
29 lines (25 loc) · 1.2 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
% this code extracts all the refernce block data for each session and makes
% a 5d matrix similar to AllData. This will be used to normalize AllData
% and AllData_prereach.
disp('starting datagen_refblk');
corrsessns=1:numel(sessnames);
trltime_max_refblk=0;
% calculating the max time of ref blk:
for sessns=corrsessns
strtemp=sessnames{sessns};
slc_sessn_refblk=LoadSLC(1,['G:\Active Projects\BG2 Data\t8\' strtemp '\Data\Extracted Data']);
trltime_refblk=size(slc_sessn_refblk.ncTX.values,1);
if trltime_refblk>trltime_max_refblk
trltime_max_refblk=trltime_refblk;
end
end
AllData_refblk=NaN*ones(384,trltime_max_refblk,numel(sessnames));
for sessns=corrsessns
fprintf('sessno.%d \n',sessns);tic;
strtemp=sessnames{sessns};
slc_sessn_refblk=LoadSLC(1,['G:\Active Projects\BG2 Data\t8\' strtemp '\Data\Extracted Data']);
normalid=slc_sessn_refblk.spikePower.values(:,100)>0;normalid=normalid(:);
allids=logical([normalid ;(zeros(trltime_max_refblk-length(normalid),1))]);
AllData_refblk(:,allids,sessns)=[slc_sessn_refblk.ncTX.values(normalid,:) slc_sessn_refblk.spikePower.values(normalid,:)]';
end
clearvars slc_sessn_refblk strtemp allids normalid