-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdock.m
More file actions
25 lines (24 loc) · 740 Bytes
/
dock.m
File metadata and controls
25 lines (24 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
% Sets the figure's 'WindowStyle' property
%
% usege:
% dock; % dock the current figure
% dock on; % same as dock
% dock off; % undock the current figure
% dock all; % dock all open figures
%
function dock(option)
if nargin < 1 || strcmpi(option, 'on')
if strcmpi(get(gcf, 'WindowStyle'), 'normal')
set(gcf, 'WindowStyle', 'docked');
end
elseif strcmpi(option, 'off')
set(gcf, 'WindowStyle', 'normal');
elseif strcmpi(option, 'all')
handles = findobj('Type', 'figure');
for hFig = handles'
if strcmpi(get(hFig, 'WindowStyle'), 'normal')
set(hFig, 'WindowStyle', 'docked');
end
end
end
end