MATLAB: Create GUI figures which scale position and size based on resolution

guiguideMATLABmatlab gui

Hello, I have a program which first has one GUI which has a button which is pushed to call three other GUIs. I want these four GUIs to have a set layout, in that the initial GUI occupies ~1/4 of the screen on the left side, two GUIs stacked upon each other in the middle of the screen, then the final GUI on the right side. I have changed the positions for each and made it so that this layout is present using my laptop at its native screen resolution. The issue, however, is that I plan to give the program to others, and when I change the screen resolution of my laptop to one with a different aspect ratio of a smaller size, the distance between GUIs and their size remains the same. This pushes the last, right-most GUI partially off the screen. I have set all units, including font units and position units, to 'normalized' for all four GUI windows. Is there something else I have to do to have the window size scale automatically?
Thanks, Ak

Best Answer

Fig1H = figure('Units', 'normalized', 'Position', [0, 0, 0.25, 1], 'Name', 'Figure 1');
Fig2H = figure('Units', 'normalized', 'Position', [0.25, 0.5, 0.5, 0.5], 'Name', 'Figure 2');
Fig3H = figure('Units', 'normalized', 'Position', [0.25, 0, 0.5, 0.5], 'Name', 'Figure 3');
Fig4H = figure('Units', 'normalized', 'Position', [0.75, 0, 0.25, 1], 'Name', 'Figure 4');
This creates two figures with 1/4 of the width and the full height on the left and right, and two figures on top of each other at the center. Does this help already?