MATLAB: Maximize the GUI window

app designerappdesignerguiguidematlab guiresize

How can i maximize my GUI window keeping the ratio of all my labels and buttons maximized with the window

Best Answer

If your GUI was created in GUIDE(),
  1. open your gui in guide: guide('mygui')
  2. Select tools > GUI Options...
  3. In the "Resize behavior" dropdown box, select 'Proportional'
  4. Save, close
  5. If your GUI is already opened, close it; run your GUI
If your GUI was created programmatically using UICONTROL(),
  1. Set the units of all GUI components to 'normalized (see below)
% h is the handle to the figure hosting your gui
set(findall(h, '-property', 'Units' ), 'Units', 'Normalized' )
If your GUI was created in APP DESIGNER
  1. open your gui in app designer: appdesigner('mygui')
  2. From the component browser on the right, select the main figure (probably on top of the list)
  3. In the UI Figure Properties window below, select 'Resize components when app is resized'.
  4. Save the app; close.
  5. If your GUI is already opened, close it; run your GUI
Now you can maximize the figure and the components should scale to the new figure size.