File Exchange

image thumbnail

Dockfig/Undockfig

version 1.2.0.1 (1.99 KB) by Brett Shoelson
Programmatically dock or undock one or all open figures.

3 Downloads

Updated 01 Sep 2016

View License

dockfig(FIG)
Docks figure with handle FIG, and brings it to the front.

dockfig('all')
Docks all open figures
undockfig(FIG)
Undocks figure with handle FIG, and brings it to the front.

undockfig('all')
Undocks all open figures

Cite As

Brett Shoelson (2020). Dockfig/Undockfig (https://www.mathworks.com/matlabcentral/fileexchange/18194-dockfig-undockfig), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Nathan

Nice and simple and it works! "undockfig.m" Solved a headache for me, as I was trying to set the position of a figure programmatically using the property 'outerposition', which doesn't work when the figure is docked.

Anna

Mikhail Poda

It's a pity that docking does not work with compiled Matlab (at least in R2006a) ...

John D'Errico

Well done.

Brett Shoelson

Thanks for the input, John. You're absolutely right; lack of default behavior was an oversight on my part. I've corrected and reposted the functions. Thanks.

John D'Errico

Pretty good. Good help as you would expect. It even works on my Mac.

I was only surprised at one thing - there is no default for these functions when called with no arguments. They generate an error. It would make far more sense to me if either the current figure is docked/undocked or all of them are. Either of these options would be fine.

Updates

1.2.0.1

Updated license

1.2.0.0

added Mathworks copyright to license and M files

1.1.0.0

added copyright

1.0.0.0

Per John's suggestion, providing default behavior when no input is provided. (Operates on current figure.)

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux