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;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章