Dear members:
I am a vision researcher, currently using psychtoolbox to program my experiment, the plan is to present two streams of images with different frequencies simultaneously on one monitor.
To be more percise, I want the two scripts to start at the same time. I have tried parallel computing toolbox, but with little success, just wondering whether there is an easier way to program for what I entended.
e.g.,
Right side: imageA -> imageB -> imageA -> imageB…
nPresentations = 10 for presentationcount = 1:nPresentations %10 rounds
image = imread('imageA.jpg'); % present imageA for 1 second
texture = Screen('Maketexture', windowPtr, image); Screen('DrawTexture', windowPtr, texture, [], destinationRect_R); Screen('Flip', windowPtr); WaitSecs(1); image = imread('imageB.jpg'); % present imageB for 0.5 second
texture = Screen('Maketexture', windowPtr, image); Screen('DrawTexture', windowPtr, texture, [], destinationRect_R); Screen('Flip', windowPtr); WaitSecs(0.5); end
Left side: imageC -> imageD -> imageC -> imageD…
nPresentations = 20 for presentationcount = 1:nPresentations %20 rounds
image = imread('imageC.jpg'); % present imageC for 0.7 second
texture = Screen('Maketexture', windowPtr, image); Screen('DrawTexture', windowPtr, texture, [], destinationRect_L); %draw texture on the left side
Screen('Flip', windowPtr); WaitSecs(0.7); image = imread('imageD.jpg'); % present imageD for 0.3 second
texture = Screen('Maketexture', windowPtr, image); Screen('DrawTexture', windowPtr, texture, [], destinationRect_L); Screen('Flip', windowPtr); WaitSecs(0.3); end
Thanks in advance
Best Answer