How can I define a time for a button to be pressed?

조회 수: 1 (최근 30일)
Joana Alves
Joana Alves 2017년 6월 29일
답변: Walter Roberson 2017년 6월 29일
Hi!
I'm writting a code where I want a button (key or mouse) to be pressed when an image appears. I have used waitforbuttonpress but it stops the image until a button is pressed. I want to have the possibility of any button to be pressed when an imagem appears, but only for a limited time. My code is:
imshow(im_b);
w=waitforbuttonpress;
reaction=toc(tstart);
imshow(im_preto);
However I want a waiting of 10 to 15seconds.
If anyone could help me I would appreciate. Thanks!

답변 (1개)

Walter Roberson
Walter Roberson 2017년 6월 29일
... though it sounds to me as if you should be considering using PsychToolbox

카테고리

Help CenterFile Exchange에서 Timing and presenting 2D and 3D stimuli에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by