How to randomize visual presentation trials when each trial contains multiple, separately presented images.
4 views (last 30 days)
Show older comments
I have very little experience with MatLab. I am trying to develop a visual perception experiment using MatLab.
In this experiment, subjects will first be presented with an object consisting of three simple shapes. Then, they will be shown a second image, which is either identical or different. These images will be .jpg images, created outside of MatLab.
The subject's task is to press a key (s) if the objects are the same and a different key (d) if the objects are different. The results I am collecting will be error rates and reaction times. I have figured out how to present visual stimuli and get a response using MatLab.
My problem is that, for this experiment, each trial consists of one image (image1) followed by the presentation of another image (image2). I need the trials to be randomized but within each trial, I need to present the two images in a specific order: image1, then image2. I will have 320 separate trials, each consisting of two images. How do I get MatLab to randomize the individual trials without randomizing the presentation of the images within a single trial?
I realize you won't be able to tell me the entire coding necessary to do this, but maybe give me the code for an experiment that uses a similar paradigm or even tell me the name of a book that specifically tells me how to do this. Thanks in advance.
0 Comments
Answers (1)
Doug Hull
on 23 Jul 2012
for i = 1: nTrials
imshow(image_i)
if rand<0.5 (randomly choose A)
imshow(image_iGood)
else
imshow(image_iBad)
end
end
The above will get you to choose between two options for the second image.
See Also
Categories
Find more on Timing and presenting 2D and 3D stimuli in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!