Set GUI to screen size: set(handles.figure1,'Position',get(0, 'ScreenSize'));
Show older comments
Hello,
I am writing a GUI and as many user I want it to be maximize as soon as the user launch it. I used GUIDE to do it: my GUI has 3 panels with a toolbar, following these advices Create tab with matlab using panel .
I put this line to the opening function
set(handles.figure1,'units','norm','Position',[0 0 1 1]);
Expecting of course to get the gui maximize. Unfortunately it is not the case, see figure below:

Any ideas ?
ML
Accepted Answer
More Answers (2)
Jan
on 16 Feb 2016
Try to use
set(handles.figure1, 'units', 'norm', 'OuterPosition', [0 0 1 1]);
3 Comments
Michael Lherbette
on 16 Feb 2016
Jan
on 18 Feb 2016
What do you get for:
set(figure, 'units','norm','Position',[0 0 1 1]);
? If you get a full size figure, as expected, I guess, that you have any other code, perhaps in the ResizeFcn, which reduces the figure size. Use the debugger to step through the code line by line to identify the command, which changes the size.
Michael Lherbette
on 19 Feb 2016
Image Analyst
on 18 Feb 2016
0 votes
You're right - that doesn't do true maximization.
I use Yair Altman's maximizefigurewindow() function, attached.
1 Comment
Michael Lherbette
on 19 Feb 2016
Categories
Find more on Startup and Shutdown 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!