Created
March 29, 2013 07:19
-
-
Save liborw/5269266 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function namedfig(name) | |
| %NAMEDFIG Create or select named figure. | |
| % Libor Wagner on March 25, 2013 | |
| persistent figs | |
| % Reset if requested | |
| if nargin<1 | isempty(name) | |
| figs = []; | |
| return | |
| end | |
| % Initilaize figs map | |
| if isempty(figs) | |
| figs = containers.Map; | |
| end | |
| % Select or crate named figure | |
| if isKey(figs, name) | |
| h = figs(name); | |
| figure(h); | |
| % Set window name | |
| set(h,'Name',name,'NumberTitle','off'); | |
| else | |
| h = figure(); | |
| figs(name) = h; | |
| % Set window name | |
| set(h,'Name',name,'NumberTitle','off'); | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment