how MATLAB determines order of monitors
5 views (last 30 days)
Show older comments
Does anyone know how MATLAB determines the order of the monitors, when multiple monitors are connected?
I did this:
>> get(0, 'MonitorPositions')
ans =
-1919 -2182 1920 1080
1 1 1536 864
Why isn't the monitor whose position starts with (1,1) the first? My Windows settings clear state that this monitor is the principal one. Even if I go to Windows settings and rearranje the monitors (left-right), nothing changes (only the coordinates change). And if I set the secondary monitor as the principal one, nothing changes either.
Restarting MATLAB does not solve the issue (only the coordinates change).
Restarting Windows does not solve the issue (only the coordinates change).
I need a consistent way to identify each monitor being used by MATLAB.
0 Comments
Answers (1)
Taylor
on 23 Jan 2024
Can you share the values you get when restarting MATLAB and Windows? It's hard to tell exactly why the (1, 1) monitor isn't the first index, but it may be as simple as they sort the indexes based on the x-position. I have two monitors and this is my return:
get(0, "MonitorPositions")
ans =
1 1 1920 1080
1921 1 1920 1080
My primary monitor is on the left so this ordering makes sense to me. I'm wondering if your primary monitor is on the right which is why you're seeing negative position values.
1 Comment
See Also
Categories
Find more on Function Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!