clc;                                                                            % clear the command window
clear all;                                                                      % clear all variables in memory
close all;                                                                      % close all windows and ports
rng('shuffle');                                                                 % seed the random number generator

Screen('Preference', 'SkipSyncTests', 1);                                       % skip the Sync tests
[window, window_size] = Screen('OpenWindow', 0, [0 0 0], [],32,2);              % open a drawing window

x_middle = window_size(3) / 2;                                                  % get the x coordinate of the middle of the screen
y_middle = window_size(4) / 2;                                                  % get the y coordinate of the middle of the screen
stim_size = 20;                                                                 % specify a stimulus size
Screen('FillRect', window , [255 0 0], [x_middle-stim_size y_middle-stim_size x_middle+stim_size y_middle+stim_size]);     % draw a circle

Screen('Flip',window);                                                          % push the current drawing to the screen
    
WaitSecs(3);                                                                    % wait for 3 seconds

Screen('CloseAll');                                                             % close the drawing window