Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
function [] = setPlotHandleVisibility(pHandles, pVisible)
%HIDEORSHOWHANDLES Summary of this function goes here
% Detailed explanation goes here
%% Parameter check
if ~islogical(pVisible)
warning('Parameter pVisible needs to be logical. Skipping...');
return;
end
%% Check data structure
if iscell(pHandles)
processCell(pHandles);
return;
end
if isstruct(pHandles)
processStruct(pHandles);
return;
end
%% Check if handle is valid
if isempty(pHandles) || ~isvalid(pHandles)
return;
end
%% Set visibility
if pVisible
pHandles.Visible = 'on';
else
pHandles.Visible = 'off';
end
function processCell(pCell)
for i = 1:length(pCell)
artoa.controller.setPlotHandleVisibility(pCell{i}, pVisible);
end
end
function processStruct(pHandles)
fnames = fieldnames(pHandles);
for oFnames = 1:length(fnames)
artoa.controller.setPlotHandleVisibility(pHandles.(fnames{oFnames}), pVisible);
end
end
end