I'm working on a project where we are recording reaction times to flashing colored red and blue squares. We show each one twice, so red/blue/red/blue and a person has to press the spacebar when they see the square. We end up with something like:
red = [2 4 3 1 2 3 4 4 3 3]
blue = [2 3 2 2 1 1 2 3 2 4]
So the 1st and 3rd value, 2nd and 4th, etc of red I'd like to find the mean and then plot it against the blue's 1st and 3rd, 2nd and 4th, etc to see if red is faster than blue.
I was thinking of doing
but xperson1 keeps ending up as a 1x12 double instead. Do I need to write a for loop for this? What syntax should I be using?