try
    screens = Screen('Screens');
    whichscreen = max(screens);
    [myscreen,rect]=Screen('OpenWindow',whichscreen);
    DrawFormattedText(myscreen, 'PRESS ANY KEY TO PROCEED','center', ...
    'center');
    Screen('Flip', myscreen);
    KbWait;
    screen('CloseAll');
catch
    Screen('CloseAll')
    rethrow(lasterror)
end