What function can I use in MATLAB 2016a to replace "BlackIndex" and "Screen"? These do not work with my version of MATLAB.

I am trying to run some old code passed on to me. It contains the functions "BlackIndex", "WhiteIndex", and "Screen", but none of these are recognized by my version of MATLAB - 2016a. Is there a different function that I can use instead, or can I extract this information a different way?
Here is the current code which does not work in my version of MATLAB:
backgroundColor = BlackIndex(screenNumber);
foregroundColor = WhiteIndex(screenNumber);
[window, windowrect] = Screen(screenNumber, 'OpenWindow', backgroundColor);
% Create light blue colored screen
wBB= Screen(window,'OpenOffscreenWindow',[238 238 175],[0 0 resx resy]);
% Copy black screen to wCopy
wCopy = Screen(window,'OpenOffscreenWindow');
Screen('CopyWindow',window,wCopy);

 Accepted Answer

None of those are Mathworks functions in any Mathworks toolbox.
I recognize Screen, though: it is part of the third-party Psychtoolbox; http://psychtoolbox.org/ so probably you need to install that.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!