We now need to start making multiple trials. For this, and all subsequent assignments the code will not appear here in the window unless it is a new command. But in terms of an overview, a loop for trials is simply:
for trial_counter = 1:number_of_trials
our trial code
end
So, HERE is come code that takes our previous trial and puts it into a loop to simulate a series of trials. Things to look for:
1. The for loop. See how it works. What is in the for loop? What is not in the for loop. Think about why.
2. We are going to store the reaction time data in a variable called subject_data. Make sure you look at that when you are done reading and playing with the code.
So now, read through the code line by line. See what is the same as the previous tutorial and what is different. Play the code a few times. Then, try the challenges below.
Challenges
1. Change this so it is a response to a beep.
2. Add more stimuli and more response keys.
3. Do some analysis with student data. Try and plot the mean reaction time for left versus right responses.
The purpose of these assignments are to really read the code and see what it is doing. Make sure you have done that before you move on!
for trial_counter = 1:number_of_trials
our trial code
end
So, HERE is come code that takes our previous trial and puts it into a loop to simulate a series of trials. Things to look for:
1. The for loop. See how it works. What is in the for loop? What is not in the for loop. Think about why.
2. We are going to store the reaction time data in a variable called subject_data. Make sure you look at that when you are done reading and playing with the code.
So now, read through the code line by line. See what is the same as the previous tutorial and what is different. Play the code a few times. Then, try the challenges below.
Challenges
1. Change this so it is a response to a beep.
2. Add more stimuli and more response keys.
3. Do some analysis with student data. Try and plot the mean reaction time for left versus right responses.
The purpose of these assignments are to really read the code and see what it is doing. Make sure you have done that before you move on!