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

**URL:** <https://psychtoolbox.discourse.group/t/i-am-recieving-a-value-of-10-for-the-screen-number-when-i-only-have-2-screens/5776>\
**Category:** Programming Help\
**Created:** [December 12, 2025, 5:44pm UTC](https://psychtoolbox.discourse.group/t/i-am-recieving-a-value-of-10-for-the-screen-number-when-i-only-have-2-screens/5776 "2025-12-12T17:44:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![malmberg](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@malmberg](https://psychtoolbox.discourse.group/u/malmberg)\
**Post date:** [December 12, 2025, 5:44pm UTC](https://psychtoolbox.discourse.group/t/i-am-recieving-a-value-of-10-for-the-screen-number-when-i-only-have-2-screens/5776/1 "2025-12-12T17:44:17Z")

</div>

=== delete this after reading ===  
Please make sure _**[you read this post](https://psychtoolbox.discourse.group/t/posting-guidelines/3058)**_ 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?

---

<div class="post-metadata">

**Author:** ![xiangrui](https://avatars.discourse-cdn.com/v4/letter/x/ec9cab/32.png) [@xiangrui](https://psychtoolbox.discourse.group/u/xiangrui)\
**Post date:** [December 12, 2025, 6:53pm UTC](https://psychtoolbox.discourse.group/t/i-am-recieving-a-value-of-10-for-the-screen-number-when-i-only-have-2-screens/5776/2 "2025-12-12T18:53:54Z")

</div>

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