My code was successfully in use numerous times for an experiment in June using Matlab R2014b and Psychtoolbox (PTB) 3.0.10 on a Mac OS X El Capitan Version 10.11.5. I have recently come back to it and the gamma correction isn't holding. It flashes onto the screen for just less than a second, and then goes away again. This is not activated by any input (keypress/mouse movement); the gamma simply flashes onto the screen and then leaves again in under a second.
I had thought that the problem was that I had recently updated to PTB 3.0.13. However, having uninstalled PTB 3.0.13 and reinstalled PTB 3.0.10, the problem is still there.
This is happening with all my codes that I gamma corrected. Other screen functions of psychtoolbox are working fine.
All these options have the same result;
Screen('LoadNormalizedGammaTable',screenNumber,[GammaRed GammaGreen GammaBlue]);
Screen('LoadNormalizedGammaTable', screenNumber, [GammaRed GammaGreen GammaBlue]/255);
WaitSecs(5);
Screen('LoadNormalizedGammaTable', screenNumber, [GammaRed GammaGreen GammaBlue]/255, 1);
Screen('Flip',w);
Screen('LoadCLUT', w, [RGB(1)*GammaRed RGB(2)*GammaGreen RGB(3)*GammaBlue]);
ClutAnimDemo and ClutAnimDemo (2) work so there is nothing wrong with the screen.
The other very odd thing is that this was initially only a problem on a second screen, and the gamma was working when I ran the code on my laptop alone, but now it is happening on my laptop too when I don't link up to another screen.
When I put
Screen('LoadCLUT', w, [GammaRed GammaGreen GammaBlue]);
into a loop, the gamma is kept on the screen. So my long winded solution is to re-code, or hack the demo. A more elegant solution would be much appreciated though.
Thanks.