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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
| function pageconsigne
TailleEcran = get(0,'ScreenSize');
figure('Name','TESTANTISACCADE','Position',[TailleEcran(1) TailleEcran(2) TailleEcran(3) ...
TailleEcran(4)],'MenuBar','none',...
'ToolBar','none','KeyPressFcn',@printfig);
set(gcf,'Color',[0 0 0])
text(0.2,0.7,'Fixez le point noir qui va apparaitre au centre de l''écran.','Fontsize',30,'fontname','Times new roman','fontweight','bold', 'color','red')
text(0.2,0.5,'Dans un second temps, vous devrez pointer du doigt aussi','Fontsize',30,'fontname','Times new roman','fontweight','bold', 'color','red')
text(0.25,0.43,'rapidement et aussi précisement que possible','Fontsize',30,'fontname','Times new roman','fontweight','bold', 'color','red')
text(0.22,0.36,'à l''opposé des points rouges apparaissant à l''écran.','Fontsize',30,'fontname','Times new roman','fontweight','bold', 'color','red')
axis off
pause (3)
clear ('f')
set(gcf,'Color',[0 0 0])
point0 = [0 0]; %coordonnée point central
plot(point0,point0,'.w','markersize',50);% dessine le point de taille 50 de coordonnée 0 0, de forme point en blanc
axis([-3 3 -3 3]); % défini la taille des axe suivant X et Y, min et max
axis off % dit qu'il ne doit pas afficher les axes
compteur1 = 0;
compteur2 = 0;
compteur3 = 0;
function printfig(~,~)
essai = randi([1 3],1,1);
if (essai == 1);
x1 = -2;
y1 = 0;
plot(x1,y1,'.r','markersize',50);
axis([-3 3 -3 3]);
axis off
pause (2)
if compteur1 <= 3
compteur1 = compteur1 + 1
plot (x1,y1,'.r','markersize',50);
end
if compteur1 > 3
plot (point0,point0,'.w','markersize',50)
essai = randi ([2 3],1,1)
end
end
%___________________________________________________________________
if (essai == 2);
x2 = -1;
y2 = 0;
plot(x2,y2,'.r','markersize',50);
axis([-3 3 -3 3]);
axis off
pause (2)
if compteur2 <= 3
compteur2 = compteur2 + 1
plot (x2,y2,'.r','markersize',50);
end
if compteur2 > 3
plot (point0,point0,'.w','markersize',50)
essai = randi ([1],[3],1,1)
end
end
%__________________________________________________________________
if (essai == 3);
x3 = 1;
y3 = 0;
plot(x3,y3,'.r','markersize',50);
axis([-3 3 -3 3]);
axis off
pause (2)
if compteur3 <= 3
compteur3 = compteur3 + 1
plot (x3,y3,'.r','markersize',50);
end
if compteur3 > 3
plot (point0,point0,'.w','markersize',50)
essai = randi ([1 2],1,1)
end
end
plot(point0,point0,'.w','markersize',50);
axis([-3 3 -3 3]);
axis off
end
end |
Partager