Matlab Screen Size incorrect
21 views (last 30 days)
Michelle Hirsch on 26 Jan 2015
Did you by chance change the screen resolution after starting MATLAB. The ScreenSize property is fixed when MATLAB starts up. If that's not it, I don't have any other ideas.
Guillaume on 23 Jan 2015
Certainly don't know why the discrepancy.
If you do need the screen size in matlab, you could always go through .Net (Windows only), or java.
rect = System.Windows.Forms.Screen.PrimaryScreen.Bounds
screensize = [rect.Width rect.Height]
ge = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment;
gd = ge.getDefaultScreenDevice;
screensize = [gd.getDisplayMode.getWidth gd.getDisplayMode.getHeight]
Matt on 6 Mar 2017
Edited: Matt on 6 Mar 2017
Further to Guillaumes comment, which I hadn't actually seen.
I have just had this issue myself. Screensize returned a size in pixels/resolution of 1536x864 on a screen I knew was 1080p capable and set to 1920x1080 resolution.
I right clicked on my Matlab shortcut, and ticked "Disable Display Scaling on High DPI Settings" and now screensize is returned as 1920x1080 as I would expect.
Petorr on 13 Dec 2017
I had a similar issue; I think it was because I un-docked my laptop and then re-docked it (I have a dual-monitor display dock), and the monitor info may have not updated accordingly. I restarted matlab and things returned to normal. I am using get(0,'MonitorPositions').