-
Notifications
You must be signed in to change notification settings - Fork 14
/
ploteyesac.m
52 lines (44 loc) · 1.37 KB
/
ploteyesac.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
43
44
45
46
47
48
49
50
function ploteyesac(filename,trials,info)
%% quick tool to plot eye positions for a given trial, with detected saccade times
if nargin<3
info=num2str(trials);
end
load(filename);
figure;
if length(trials)>5
trials=trials(1,5);
end
for i=1:length(trials)
subplot(length(trials),1,i) %ceil(length(trials)/2)
plot(allh(trials(i),:));
hold;
plot(allv(trials(i),:),'r');
goodsac=find(~cellfun(@isempty,{saccadeInfo(trials(i),:).latency}),1);
alltimes={saccadeInfo(trials(i),:).starttime};
alltimes=cell2mat(alltimes(~cellfun(@isempty,alltimes)));
plot(alltimes,5*ones(1,length(alltimes)),'dk');
if ~isempty(goodsac)
plot(alltimes(goodsac),5,'dr');
end
title(info(i,:));
hold off;
end
end
% foo=trialq(find(wrongdircode));
% foo(end-4:end)
% trialstoplot=trialq(find(wrongdircode,1,'last'))-4 ...
% :trialq(find(wrongdircode,1,'last'))
% trialangle=anglediff(find(wrongdircode,1,'last')-4 ...
% :find(wrongdircode,1,'last'))
% trialcodes= allcodes(trialstoplot,2);
% foo=trialq(find(abs(anglediff)>45));
% foo(end-4:end)
% trialstoplot=foo(end-4:end);
% foo=anglediff(find(abs(anglediff)>45));
% trialangle=foo(end-4:end)
% trialcodes= allcodes(trialstoplot,2)
% foo=92:96;
% trialstoplot=trialq(foo);
% trialangle=anglediff(foo);
% info=round([trialstoplot,trialangle,trialcodes])
% ploteyesac(trialstoplot,rexloadedname,num2str(info))