Psychtoolbox绘制矩形matlab代码

代码简化自psychtoolbox提供的demo:square demo

%% 画矩形
PsychDefaultSetup(2);
[window, windowRect] = PsychImaging('OpenWindow', 0,0,[0,0,1920,1200]);
%矩形参数设置
[xCenter, yCenter] = RectCenter(windowRect);
baseRect = [0 0 200 200];
centeredRect = CenterRectOnPointd(baseRect, xCenter, yCenter);
rectColor = [1 0 0];
Screen('FillRect', window, rectColor, centeredRect);
%在屏幕上显示以上内容
Screen('Flip', window);
%按键终止程序
KbStrokeWait;
sca;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章