MATLAB: Is the GUI stretched on a screen with lower resolution than mine

MATLABscreenpixelsperinch

I made a few GUIs on my computer, which has a 1200 x 1920 screen resolution.
I tested it on my colleague's machine who has a 1920 x 1080 resolution. However the GUI is stretched.
Could you please assist me with this issue? Thanks!

Best Answer

On your colleague’s machine, the GUI was large because they had “ScreenPixelsPerInch” value equal to 116 instead of 96 (as on your machine).
You can:
1. Either use inches or centimeters as units for your GUI components, since these are fixed units, and do not change regardless of the machine's screen resolution, OR
2. Change the number of pixels per inch on the machine where the GUI is stretched
>> set(0,'ScreenPixelsPerInch',96)
For more information on the root object (computer screen display) properties, please execute the following at the command line:
>> web([docroot '/matlab/ref/rootobject_props.html'])
And search for “ScreenPixelsPerInch”.
3. Another idea would be to have units as normalized. The GUI will be to scale for each screen resolution/size, i.e small on your screen, and large, but to scale on your colleague’s.