No BSD License  

Highlights from
Maximize window

4.82609

4.8 | 23 ratings Rate this file 25 Downloads (last 30 days) File Size: 3.84 KB File ID: #3812
image thumbnail

Maximize window

by Yuval Cohen

 

05 Aug 2003 (Updated 22 Mar 2005)

Maximize window size to fill the entire screen. Has learning capability.

| Watch this File

File Information
Description

Maximize the size of figures and GUIs to fill the entire screen.

The function was tested under the following conditions:
screen resolutions:
[800x600]
[1024x768]
[1152x864]
[1280x960]
Matlab version: R12, R13
OS: WinXP

The function was calibrated to handle WinXP standard toolbar (at the bottom of the screen, one icon row) and standard screen (4x3 ratio - not wide).

If you are using different settings, the maximized figure size could be wrong. If you find yourself in such a position, fear not. Run the function in 'calibrate' mode to calibrate the settings.

The application will ask you to maximize a figure window manually and use these settings as a reference from now on.

2005-03-21 update - contribution of Tim Myers
Maximize can set the image to fill any portion of the screen.

Acknowledgements
This submission has inspired the following:
subfig
MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (26)
08 Aug 2003 Kousuke Miyahara

Works as advertized. The only file I found here that makes the figure fill the entire screen. Even thought the figure is not "Maximized", the size and position are exactly the same.
Well done

14 Aug 2003 Brahim Hamadicharef

Thanks for this !
I do often prefer FULL SCREEN !

Brahim

01 Feb 2004 Aaron Luttman

This is exactly what I have needed for opening and closing a lot of different plot windows, since I always want them maximized. This is a nice easy way to do it, and it works exactly as it says.

02 Mar 2004 Marc Franco

Works great. Good job!

08 Mar 2004 Jim Bean  
09 Mar 2004 Muni Gangabathina

Cool. This is exactly what I wanted!

01 Jul 2004 Ugo Di Girolamo

does not handle my office toolbar, though

24 Aug 2004 Tim Myers

I tried a few different functions all claiming to do the same thing. This function is the only one that worked properly on all screen resolutions. Hopefully, Matlab will include this type of function in a near-term release.

26 Oct 2004 David Babineau

Excellent! Very easy to use and handy.

21 Nov 2004 Alfredo Fernandez  
08 Mar 2005 Kai-Cheng Hu

Thank you so much. It works properly on my PC . And I also learned some skills form your code(ex:an undocumented fig property-- ActivePositionProperty d). That is so perfect than I wrote.

02 May 2005 Kjetil Sæheim

Thanks!

23 Aug 2005 Florian Weichert

Really useful.

10 Nov 2005 Julie Meng

Beautiful!!

14 Jan 2006 Kiran Misra

Awesome .. saved my butt.

08 Feb 2006 yaniv the magnificent

Tevorah :)
It was great...

thanks a lot.
Yaniv and Amit.

04 Sep 2006 Emma Peeling

This is excellent... just what I need and works exactly as described

23 Oct 2006 Wenying Shou

Nice!

29 Jan 2007 Junior JR

Excellent

07 Mar 2007 Serge Thill

Just for information, if the purpose is simply to maximse a window, these two lines (slightly modified from the Matlab help) should also do the job:
scrsz = get(0, 'ScreenSize');
figure('Position', [1 scrsz(4) scrsz(3) scrsz(4)]);

12 Apr 2007 James Huber

Also, try it this way:

scrsz=get(0,'ScreenSize');
maxWindow=[1 31 scrsz(3) scrsz(4)-104];
%31 happens to be the pixel width of the task bar and 73 was the space required for the figure toolbar (73+31=104)
h=figure(17);
%choose any number that is available
set(h,'Name','MyGraphTitle','NumberTitle','off','Position',maxWindow)
%maxWindow is in the form [distance-from-left distance-from-bottom window-width window-height]

Also, you can find your maximized position this way:
figure(1);
%manually maximize the window with the mouse here
maxWindow=get(1,'Position')

You can deterimine the default window size this way:
get(0,'Position)

06 Apr 2009 Andranik Valedi

Well done! Works just as a maximized window does, without the window being "maximized" in Windows terms.

10 Dec 2009 Brahim HAMADICHAREF

You can also add

elseif screen(3) == 1680
   set(gcf,'Units','normalized','Position',[0.00 0.0267 1.0 0.9095])

works for me !

19 Apr 2010 Steven  
21 Jun 2011 Gautam Dugar  
12 Jan 2012 joo tan

i try use this program..but failed..what the value for (h)? still confuse..help me

Please login to add a comment or rating.
Updates
18 Aug 2003

Updated calibration process.

22 Mar 2005

New feature - resize image to fill a portion of the screen

Tag Activity for this File
Tag Applied By Date/Time
annotation Yuval Cohen 22 Oct 2008 07:05:54
customization Yuval Cohen 22 Oct 2008 07:05:54
window Yuval Cohen 22 Oct 2008 07:05:54
figure Yuval Cohen 22 Oct 2008 07:05:54
maximize Yuval Cohen 22 Oct 2008 07:05:54
resize Yuval Cohen 22 Oct 2008 07:05:54
resizable Yuval Cohen 22 Oct 2008 07:05:54

Contact us at files@mathworks.com