-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgetBuildRMatrix.m
More file actions
73 lines (65 loc) · 1.44 KB
/
Copy pathgetBuildRMatrix.m
File metadata and controls
73 lines (65 loc) · 1.44 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
function [StimFormal,StimAtt,StimTime,RFormal,RAtt,RTime] = getBuildRMatrix(ResponseCell)
%Pass the response cell with rows as stimuli (i.e. 16 images or 8
%gratings). This function returns stimulus and response arrays for
%'formal','attribute' and 'time' information calculation respectively
%StimmulusArray
numTimeBins = size(ResponseCell{1,1},2);
StimFormal = [];
n=1;
for i=1:size(ResponseCell,1)
for t=1:numTimeBins
temp = ResponseCell{i,1};
A = n*ones(size(temp(:,t),1),1);
StimFormal = cat(1,StimFormal,A);
n = n+1;
end
end
clear('temp');
StimAtt = [];
n = 1;
for i=1:size(ResponseCell,1)
temp = ResponseCell{i,1};
A = n*ones(size(temp,1)*size(temp,2),1);
StimAtt = cat(1,StimAtt,A);
n = n+1;
end
clear('temp');
StimTime = [];
temp = cell2mat(ResponseCell);
n = 1;
for i=1:numTimeBins
A = n*ones(size(temp(:,i),1),1);
StimTime = cat(1,StimTime,A);
n = n+1;
end
%Response Array
clear('temp');
RFormal = [];
n = 1;
for i=1:size(ResponseCell,1)
for t=1:numTimeBins
temp = ResponseCell{i,1};
A = temp(:,t);
RFormal = cat(1,RFormal,A);
n = n+1;
end
end
clear('temp');
RAtt = [];
n = 1;
for i=1:size(ResponseCell,1)
temp = ResponseCell{i,1};
A = temp(:);
RAtt = cat(1,RAtt,A);
n = n+1;
end
clear('temp');
RTime = [];
temp = cell2mat(ResponseCell);
n = 1;
for i=1:numTimeBins
A = temp(:,i);
RTime = cat(1,RTime,A);
n = n+1;
end
end