Uses an undocumented figure property to maximize a figure window in a hardware independent way.
compiled matlab GUI with maximize function in linux,
throws warning "File is empty" at runtime in linux.
set(gcf,'Units','normalized', 'WindowStyle','docked','OuterPosition',[0 0 1 1]); will maximize the figure in a way that is analagous to hitting the 'maximize' button in windows.
Does what I want it to. Saves time. Fun!
Simple but Perfect!
Very useful... thank you. Couple of improvements:
1. When you set the "outerposition" property, the figure's "ActivePositionProperty" automtically changes. So you need to remember what it was, and then reset it later, as you do with "units" property.
2. On Windows, the maximized figure window is obscured by the taskbar at the bottom... (31 pixels on XP and Vista). So, you may want to get the screensize and adjust the "outerposition" proportionately. E.g., for a screen with vertical resolution of 1050, for "outerposition," I will have [0, 31/1050, 1, (1050-31)/1050].
Simple and very useful
Sometimes just the small features are a great help...thank you for finding this.
works in Matlab 2007b, under Linux
Works for me...R2007a
works good on Linux, debian matlab 7.4
Worked for me, thanks!
Just what I was looking for (working good under Linux/Fedora/KDE & Matlab R13)!
It works fine.
I usually use a taskbar with two rows of buttons, in this case it is not exactly the same as clicking the maximize button, but I can stand it.
Under R2006a and CentOS 5 (Gnome) it has the same behavior than the maximize button.
Seems to work fine - much better than the (0,'ScreenSize') method.
doesn't do the same as pressing the "maximize" button and doesn't take the size of the taskbar into consideration.
MAximizing in the Windows sense appears to be impossible in Matlab. Either it should be a figure property, or there should be status-sniffing of the get(0,'ScreenSize') property, but that would discard the taskbar. I use a right hand vertical taskbar on a wide screen, other users in the group either followed me or kept the bottom task bar. I can't make figures fir everybody's screen. Bummer.
Work fine to me, but does not maximize really the window
it's only a change of the size inside Matlab (three lines of command), but it does not make what happen when you click on the "maximize" square on the right top of a windows window.
Usefull! Changes figure size to entire screen, but does not maximize it in the ms-windows sense.