Calculate Time from presenting a sound up to clicking a button in mouse. (Reaction Time)

조회 수: 5 (최근 30일)
Hello everybody, I have a problem with this following issue:
I generate some sounds and participent for every sound push the right or left button in mouse. Right now I want to calculate time from when the sound is sent in ears to when the participant presses the right or left clicks.(Reaction time). line 16 from my code, I use a function from Psychtoolbox in Matlab.
Please if anyone have any ideas tell me about that.
(http://psychtoolbox.org/docs/GetClicks)
clc
clear;
SamplingRate=48000;
F=[250 500 1000 2000 4000];
t=linspace(0,1,SamplingRate);
ind=0;
memory{1,1}={0};
for i=1:length(F)
ind=1+ind;
Frequency = F(i);
y=sin(t*2*pi*Frequency);
%% This here I want to calculate time from a sound will present in ear up to a participent click left or right button in mouse
% It means, calculate Reaction time
sound(y,SamplingRate) ;
[clicks,~,~,whichButton] = GetClicks; %% This function is related to the Psychtoolbox in Matlab
%%
pause(5)
memory{1,ind} = y';
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image display and manipulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by