% FlipScreen.m % % This program opens a window using Psychtoolbox 3.0, % makes the window black, then white, and then closes % the window again. % % written for Psychtoolbox 3 on the PC by YW 3/2023 try clear all screens=0; [wPtr,rect]=Screen('OpenWindow',screens, 0, []); HideCursor; tic while toc<5 end black=BlackIndex(wPtr); white=WhiteIndex(wPtr); Screen('FillRect',wPtr,white); Screen(wPtr, 'Flip'); tic while toc<5 end Screen('Close', wPtr); ShowCursor; catch Screen('CloseAll'); rethrow(lasterror) end