-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgetInfo.m
41 lines (31 loc) · 1021 Bytes
/
getInfo.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
function info = getInfo(data)
% get trial type information contained into data
%
% for reaching data assumes data.info has plane, start, and target codes
% plane: 1 -> frontal, 2 -> sagittal
% start, target: 0 -> center, 1 -> medial/back, 3 -> down, 5 ->
% lateral/forward, 7-> up
%
% Synergy Analyzer Toolbox for MATLAB: https://github.com/SynergyAnalyzer/SynergyAnalyzerToolbox.git
% License: GNU GPL v3
%
ntrial = length(data);
for i=1:ntrial
% id
info(i).id = i;
% type
info(i).type(1) = data(i).info.plane; % plane
if data(i).info.start==0 % center-out/out-center, direction
info(i).type(2) = 1;
info(i).type(3) = data(i).info.target;
else
info(i).type(2) = 0;
info(i).type(3) = mod(data(i).info.start+3,8)+1; % assumes 8 targets
end
% selected
info(i).selected = 1;
% events
info(i).events.code = [13 14];
info(i).events.time = [data(i).info.t_onset data(i).info.t_end];
end
end