Dear Friend:
I want to display stimulus for 1 second, and 2 seconds blank screen, so the
total inter-stimuli interval is 3 seconds. In the following codes, I try to
use the out while loop for inter-stimuli interval, and the inner loop for
display time. The problem is the stimulus "red" was displayed for 3 seconds
instead of 1.
Any comments are appreciated. Once again, it will be great if any one can
send me some programs for me to study. I have studied all the demo programs.
Jiansong Xu
w=Screen('OpenWindow', screenNumber,0,[],32,2);
Screen('FillRect', w, white);
Screen('TextFont',w, 'Courier');
Screen('TextSize',w, 50);
Screen('TextStyle', w, 0);
isi_start = GetSecs;
isi_duration = 0; % inter-stimuli interval
display_end = 0; % display time
while isi_duration < 3000
display_start = GetSecs;
while display_end < 1000
Screen('DrawText', w, 'red', 530, 530, [255,0,0]);
Screen('Flip',w);
display_end = (GetSecs - display_start)*1000;
end
Screen('DrawText', w, ' ', 530, 530, [255,0,0]);
isi_duration = (GetSecs - isi_start)*1000;
display_end = (GetSecs - display_start)*1000;
end
I want to display stimulus for 1 second, and 2 seconds blank screen, so the
total inter-stimuli interval is 3 seconds. In the following codes, I try to
use the out while loop for inter-stimuli interval, and the inner loop for
display time. The problem is the stimulus "red" was displayed for 3 seconds
instead of 1.
Any comments are appreciated. Once again, it will be great if any one can
send me some programs for me to study. I have studied all the demo programs.
Jiansong Xu
w=Screen('OpenWindow', screenNumber,0,[],32,2);
Screen('FillRect', w, white);
Screen('TextFont',w, 'Courier');
Screen('TextSize',w, 50);
Screen('TextStyle', w, 0);
isi_start = GetSecs;
isi_duration = 0; % inter-stimuli interval
display_end = 0; % display time
while isi_duration < 3000
display_start = GetSecs;
while display_end < 1000
Screen('DrawText', w, 'red', 530, 530, [255,0,0]);
Screen('Flip',w);
display_end = (GetSecs - display_start)*1000;
end
Screen('DrawText', w, ' ', 530, 530, [255,0,0]);
isi_duration = (GetSecs - isi_start)*1000;
display_end = (GetSecs - display_start)*1000;
end