get(0,'MonitorPositions') outputs wrong values
    19 次查看(过去 30 天)
  
       显示 更早的评论
    
Hello,
I have a big issue with the outputs from
get(0,'MonitorPositions')
when the screen is changed within one MATLAB session!
For example:
I start my PC and run my Monitors at my standard resolution. Then I type
get(0,'MonitorPositions')
and it is just fine.
But when i plug in a projector for example or change the resolution of my screen and just run the same code
get(0,'MonitorPositions')
then it outputs the same values like before even though the resolution obviously changed!
I have written a function that needs the correct resolution of the attached displays, but now it is just a desaster.
Hope someone can help me.
0 个评论
回答(1 个)
  Adam Danz
    
      
 2018-10-26
        
      编辑:Adam Danz
    
      
 2018-10-26
  
      MATLAB® sets the display information values for this property at startup. The values are static. If your system display settings change, the values do not update. To refresh the values, restart MATLAB.
Perhaps this API will come in handy: https://www.mathworks.com/matlabcentral/fileexchange/31437-windowapi
4 个评论
  Stephen23
      
      
 2018-10-26
				"...also don't set it up to automatically receive a message that the screen configuration has changed."
I very doubt that this is trivial to achieve on a multi-OS application.
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




