Closing the stimulus windows in Matlab/Psychtoolbox when you can't see the command line

An annoying thing that can happen if there is a big in your code is that a stimulus window gets stuck "in front" and you can't do anything about it.

The usual solution is the following:

    • Press control-C to break out of your code (if necessary)

    • Press COMMAND-0 (that is, Apple-zero) to bring the command window to the front.

    • Type sca and press return; this is a macro that executes screen('CloseAll') to close all Psychtoolbox windows.

If you have installed a color table that is full of a single color (as I often do for background windows), then the situation is harder. You have to restore the default color table, which is usually only possible if you quit MATLAB and open the "Display" preference panel and click on the "color" tab.