Azzera filtri
Azzera filtri

Measure user response time on hitting a key

2 visualizzazioni (ultimi 30 giorni)
Kevin
Kevin il 26 Gen 2012
Hi everyone,
I would like to use Matlab to measure a user's response time in front of a PC. So here is the test:
Step 1: Matlab will print a line in the command window to ask the user to hit RETURN.
Step 2: Once user sees this line in the command window, then he/she will hit RETURN.
I would like to measure the time difference between Matlab printing the message and user hitting RETURN.
The problem I have is that the user may hit RETURN before actually seeing the message. Is there any way in Matlab to print the message and then clear the keyboard buffer right after printing the message.
Thanks Kevin

Risposte (2)

Walter Roberson
Walter Roberson il 26 Gen 2012
Would it be acceptable to have a graphics window up? If so then you could use a keypressfcn callback.
Question: what if the user is holding down the return (or pressing it quickly)? Then the early keys would get discarded (with no penalty to the user) and the user would get credit for fast reactions.

Daniel Shub
Daniel Shub il 27 Gen 2012
Following on from Walter's answer.
Uses a graphics windows and a keypressfcn callback, but it makes the window invisible so it is almost like it is not there.

Categorie

Scopri di più su Desktop in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by