How to randomize visual presentation trials when each trial contains multiple, separately presented images.
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Doug Hull
2012-7-23
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Timing and presenting 2D and 3D stimuli 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!