Consistent GUI screen sizing on laptop and monitor

25 views (last 30 days)
Mason Dyess
Mason Dyess on 6 Aug 2019
Commented: Rik on 20 Aug 2019
Hi, so I have a GUI that I mainly work on at the internship I have, where I use a 1920x1080 resolution monitor. I verified that Matlab was using this same resolution by doing the get(0,'screensize') command. However, I went to work on it at home on my laptop, which is also 1920x1080 resolution, and the layout for the GUI is all messed up. Furthemore, when I did get(0,'screensize'), it says the resolution is 1280x720 even though I'm positive my laptop's screen is 1920x1080 resolution. How do I fix this so that my GUI works on both my laptop and the monitor I work on? Is there some command I can do on my laptop where I can change the Matlab resolution to 1920x1080? Does it have something to do with the fact that my laptops screen is physically smaller than the monitor screen (13'' vs roughly 24'')?
  8 Comments
Rik
Rik on 20 Aug 2019
I don't know how you could solve this, but I suggest you contact Mathworks support to see if they consider this a bug.

Sign in to comment.

Accepted Answer

Chidvi Modala
Chidvi Modala on 14 Aug 2019
You can set all the 'units' properties of all the controls to 'normalized'. You can also set the Position property to [0 0 1 1], if you want full screen.
  6 Comments
Mason Dyess
Mason Dyess on 20 Aug 2019
Thanks guys, switching to normalized units was pretty helpful for auto-resizing. However, the major issue that was causing me problems was display scaling, so thanks to @Rik for suggesting that as the potential cause.

Sign in to comment.

More Answers (1)

Chidvi Modala
Chidvi Modala on 13 Aug 2019
I am assuming that you are using GUIDE to build your GUI.
  1 Comment
Mason Dyess
Mason Dyess on 14 Aug 2019
Hi, I actually didn't use GUIDE at all to build my GUI. I instead programmatically built it using commands like uicontrol.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!