I am recieving a value of 10 for the screen number when I only have 2 screens

=== delete this after reading ===
Please make sure you read this post before asking for help. No one can help you unless you provide a clear description of the software environment you are using and your programming problem…
=== delete until here ===

Hi. I am setting up the latest version of PTB on a new machine, and the following function from Lu and Dosher’s text is returning 10 when I only have two screens:

whichScreen = max(Screen(‘screens’));

[window p.ScreenRect] = PsychImaging(‘OpenWindow’, whichScreen, p.ScreenBackground);

Thus, window is being set to 10.

Note I obtain this:

Screen(‘screens’)
ans =

0 1 2

So why is PsychImaging() returning a window pointer value of 10, which is then deemed out of bounds?

It is just an identifier for the on-screen window, and it seems PTB chose to start with 10 from very beginning.