Hello,
Here there is a part of my script. I want that after participants push the keyboard, the script continue to read the external list (items) during 800 - 1500 msec (random).
I have try this possibility :
items=textread('HorlogeAlea.txt', '%s');
nItems=length(items); % spécifie la longueur de la liste
tex=zeros(1,nItems);%Textures
Order=randi(length(items)):length(items) % premier stimulus aléatoire, puis suite de la liste
for i=Order
img=imread(items{i});
tex(i)=Screen('MakeTexture', w, img); %Faire les textures
end
cycleRefresh=Screen('GetFlipInterval', w); %Spécifie le cyclerefresh
vbl=Screen(w, 'Flip');
start=GetSecs
for i=Order
Screen('drawtexture', w, tex(i))
vbl=Screen(w, 'Flip', vbl+(2.5*cycleRefresh));
KbCheck;
if KbCheck
while GetSecs-start < 2
GetSecs
[KeyisDown, secs, keyCode, detlaSecs]=KbCheck
if strcmp(KbName(keyCode), 'm')==1
stop=GetSecs
break;
end
end
end
end
The script runs, but without what I ask (certainly, it's not the good way).
Secondly, if I want that Matlab choses between a lot a values from 800 to 1500 msec, do I create a list of value (e.g. timing), and specify GetSecs-start < timing?
Thank you very much,
Emilie
Here there is a part of my script. I want that after participants push the keyboard, the script continue to read the external list (items) during 800 - 1500 msec (random).
I have try this possibility :
items=textread('HorlogeAlea.txt', '%s');
nItems=length(items); % spécifie la longueur de la liste
tex=zeros(1,nItems);%Textures
Order=randi(length(items)):length(items) % premier stimulus aléatoire, puis suite de la liste
for i=Order
img=imread(items{i});
tex(i)=Screen('MakeTexture', w, img); %Faire les textures
end
cycleRefresh=Screen('GetFlipInterval', w); %Spécifie le cyclerefresh
vbl=Screen(w, 'Flip');
start=GetSecs
for i=Order
Screen('drawtexture', w, tex(i))
vbl=Screen(w, 'Flip', vbl+(2.5*cycleRefresh));
KbCheck;
if KbCheck
while GetSecs-start < 2
GetSecs
[KeyisDown, secs, keyCode, detlaSecs]=KbCheck
if strcmp(KbName(keyCode), 'm')==1
stop=GetSecs
break;
end
end
end
end
The script runs, but without what I ask (certainly, it's not the good way).
Secondly, if I want that Matlab choses between a lot a values from 800 to 1500 msec, do I create a list of value (e.g. timing), and specify GetSecs-start < timing?
Thank you very much,
Emilie