-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInformationSquareProtocol.m
42 lines (39 loc) · 1.63 KB
/
InformationSquareProtocol.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
%This function computes the information about one behavioural aspect of
%the rat with the square protocol in it's velocity.
%The variable type is the one which determinates the behavioural aspect.
% (0) Time information
% (1) Space Information
% (2) Directional Information
% (3) Speed Information
% (4) Space Directional Information
% (5) Speed Directional Information
function InformationSquareProtocol(directory,files,rat,areaname,area,list,freq)
count=1;
for index= 1:size(list)
order = Wished_Register_Order(area,list(index,:));
register=Rat_Register(files,area,rat,order);
[fil col]=size(register.sessions);
for se=1:col
protocol=register.sessions{se}.sess_type;
if protocol == 'C'
spikes_times= register.sessions{se}.spike_times;
pos=Loading_Pos(register,se);
tf = isfield(pos.data, 'log');
if (tf==1 && length(spikes_times)>50)
[matrix1 matrix2]=SpikesMatrix(spikes_times,pos,42,freq);
[matrix1 matrix2]=HomogeneousCountDistribution(matrix1,matrix2,10);
for j=0:5
[newmatrix nt]=SquareProtocolMatrix(matrix1,matrix2,pos,j,freq);
[I0 I1]=InformationCalculusMontemurro(newmatrix,nt);
I(count,j+1,:)=I0;
Ibias(count,j+1,:)=I1;
end
data(count,:)=area(index,:);
count=count+1;
end
end
end
end
name=strcat(directory,areaname);
save(name,'data','I','Ibias','-mat')
end