How to display multiple rects simultaneously

2 ビュー (過去 30 日間)
Cai Chin
Cai Chin 2020 年 8 月 22 日
I am using MATLAB R2020a Psychtoolbox on Mac OS. I am trying to display multiple rects using the following code but can't seem to get it to work.
% Make a base Rect of 200 by 200 pixels
baseRect = [0 0 300 75];
% Pen width for the frames
penWidthPixels = 6;
% Screen X positions of our three rectangles
squareXpos = [leftX rightX upX];
squareYpos = [leftY rightY upY];
numSquares = 3;
% Make our rectangle coordinates
allRects = nan(4, 3);
for i = 1:numSquares
allRects(:, i) = CenterRectOnPointd(baseRect, squareXpos(i), screenYpos(i));
end
%Draw rects to screen
Screen('FrameRect', window, allColors, allRects, penWidthPixels);

回答 (0 件)

カテゴリ

Help Center および File ExchangeInstallation and Operational Settings についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by