You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
3.1 KiB
Matlab

function expts_saccade_accuracy
%Test saccade accuracy for targets at different positions
%define network for performing saccades
[W,V,interconnects]=define_network(1);
[angles,ranges,partitions,values]=simulate_agent();
figoff=100;
gaze=[0:5:40];
eyepaninit=0; %[-10:10:10];
figured(figoff+1),clf,
for j=1:length(eyepaninit)
%fixate start point
[~,~,~,y]=control_eye(eyepaninit(j),0,W,V,interconnects,[],0);
%from fixation perform saccade to targets at different excentricities
for k=1:length(gaze)
[eyeamp(k),eyeposn(k,:),vistarget(k)]=control_eye(gaze(k),eyepaninit(j),W,V,interconnects,y,0);
end
%plot actual vs expected eye position
figured(figoff+1),
h(j)=plot(gaze,eyeposn(:,2),'LineWidth',3);%first saccade
hold on
%plot(gaze,eyeposn(:,3),'LineWidth',3);%second saccade
plot(gaze,gaze+eyepaninit(j),'k--','LineWidth',2); %ideal
%plot(gaze,vistarget); %visual error - just to check
end
xlabel('saccade amplitude'); ylabel('eye position post-saccade')
%legend(h,{int2str(eyepaninit')},'Location',[0.72,0.27,0.05,0.05]);
axis([0,max(gaze),min(eyepaninit),max(gaze)+max(eyepaninit)])
set(gca,'XTick',[0:20:40],'YTick',[0:20:40])
set(gcf,'PaperSize',[6 6],'PaperPosition',[0.5 0.25 5.5 5.25],'PaperOrientation','Portrait');
print('-dpdf','saccade_accuracy1.pdf')
%Simulate Albano and Wurtz 1982, Fig 6
clear eyeamp eyeposn vistarget
eyepaninit=[0:10:20];
targetposn=eyepaninit+10;
figured(figoff+2),clf,
colours=flipud(get(gca,'ColorOrder'));
for j=1:length(eyepaninit)
%fixate start point:
[~,eyepanstart,~,y]=control_eye(eyepaninit(j),0,W,V,interconnects,[],0);
%saccade to target
vistarget=targetposn(j)-eyepanstart(end);
[eyeamp(j),eyeposn(j,:),vistarget(j)]=control_eye(vistarget,eyepanstart(end),W,V,interconnects,y,0);
figured(figoff+2),
plot([eyepaninit(j),targetposn(j)],[eyeposn(j,1),eyeposn(j,2)],'LineWidth',3,'Color',colours(j,:));
hold on
plot(targetposn(j),eyeposn(j,2),'*','Color',colours(j,:),'MarkerSize',10,'LineWidth',3);
end
plot([-1,31],[-1,31],'k--','LineWidth',2);
xlabel('target position'); ylabel('eye position')
axis([-1,31,-1,31])
set(gcf,'PaperSize',[6 6],'PaperPosition',[0.5 0.25 5.5 5.25],'PaperOrientation','Portrait');
print('-dpdf','saccade_accuracy2.pdf')
%Simulate Albano and Wurtz 1982, Fig 7
clear eyeamp eyeposn vistarget
eyepaninit=[10:10:30];
targetposn=eyepaninit-10;
figured(figoff+3),clf,
colours=flipud(get(gca,'ColorOrder'));
for j=1:length(eyepaninit)
%fixate start point
[~,eyepanstart,~,y]=control_eye(eyepaninit(j),0,W,V,interconnects,[],0);
%saccade to target
vistarget=targetposn(j)-eyepanstart(end);
[eyeamp(j),eyeposn(j,:),vistarget(j)]=control_eye(vistarget,eyepanstart(end),W,V,interconnects,y,0);
figured(figoff+3),
plot([eyepaninit(j),targetposn(j)],[eyeposn(j,1),eyeposn(j,2)],'LineWidth',3,'Color',colours(j,:));
hold on
plot(targetposn(j),eyeposn(j,2),'*','Color',colours(j,:),'MarkerSize',10,'LineWidth',3);
end
plot([-1,31],[-1,31],'k--','LineWidth',2);
xlabel('target position'); ylabel('eye position')
axis([-1,31,-1,31])
set(gcf,'PaperSize',[6 6],'PaperPosition',[0.5 0.25 5.5 5.25],'PaperOrientation','Portrait');
print('-dpdf','saccade_accuracy3.pdf')