MATLAB: GUI figure doesn’t move

gui

Hi all,
I tried to move my GUI so part of it is in monitor 1 and the other part in monitor 2. I tried either use movegui or using groot to get all monitor position and set the figure handle to the set position but the GUI . My first monitor has [3200×1800] pixels and the second monitor is [1024×768]. Any suggestion please?
r = groot;
pos = r.MonitorPositions;
posShift = [pos(2,1)-500,pos(2,2)];
set(handles.figure1,'position',pos(1,1:2)+posShift ,pos(1.3:4)]);

Best Answer

There is a limitation with setting the size of a Matlab figure e.g. when the limits exceed the monitor size:
siz = get(groot, 'ScreenSize'); % e.g. [1 1 1920 1200]
FigH = figure('OuterPosition', siz);
drawnow;
get(FigH, 'OuterPosition');
Under Windows you can use https://www.mathworks.com/matlabcentral/fileexchange/31437-windowapi to set the window where ever you want, even in fullscreen (on top on the taskbar) or beyound several screens.