Using command line programs in matlab: disable screen saver during an experiment

PsychToolbox doesn’t have a function to enable or disable the Windows screensaver, and the screensaver popping seems to crash PsychToolbox. Matlab allows you to run dos programs from the command line, so a quick way to solve this issue is to grab the command line app FlipSS, put it in your experiment directory, and then run this line before Screen(‘OpenWindow’):

dos('FlipSS /off');

After Screen(‘CloseAll’) or sca you can then run:

dos('FlipSS /on');

…to reenable the screen saver. A lot simpler than a DYI mex file, if you ask me.

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s