Hello, The following code plays two beeps with a pause between them. The pause may vary within a range defined by linspace. Then randperm, randomizes the pauses. What 'c' does is combine both the functions mentioned before, in some sort of indexing device (pardon my novice-ness). When the programme ends, c displays the last randomized duration value of the range .
What I need is to graph all the user's inputs in a graph that compares them with the duration values. The problem is that when 'c' is plotted, it only shows the last duration value, as a small point in the graph.
The thing is supposed to measure the user's timing perception based on the comparison of his inputs and the duration values. It is a neuroscience experiment.
Code:
Fs=8192; %sample rate
y=sin(2*pi*2000*[0:1/Fs:0.5]); %sinewave; rate
a=linspace(0.5,1,5); %pause durations
for b=randperm(5) c=a(b) %pause's randomization by permutation
sound(y,Fs), pause(c), sound(y,Fs), %sound production
pause,tic, pause, toc %user input; timing measures
end
I hope I was clear enough. Thanks
Best Answer