function updateAnalysisPlots(handles)
% updateAnalysisPlots
%   update all availabe analysis plots

%   Project: IMPACT
%   Title of Code: updateAnalysisPlots
%   Relevant additional documentation:
%   Developer: Carlos Gonzalez
%   External Dependencies: NA
%
%   Disclaimer
%   CAUTION: It is strongly recommended that changes to this code
%   should be avoided without first consulting with authors.



hSens = findobj('type', 'figure', 'tag', 'sensDDV');
hBode = findobj('type', 'figure', 'tag', 'bodeDDV');
hNyquist = findobj('type', 'figure', 'tag', 'nyquistDDV');
hNichols = findobj('type', 'figure', 'tag', 'nicholsDDV');
hStep = findobj('type', 'figure', 'tag', 'stepDDV');

val = [hSens; hBode; hNyquist; hNichols; hStep];
if isempty(val) || strcmp(handles.Tb.Hand.status, 'on')
    return;
end



% controller tf
C = handles.C;
% plant tf
G = handles.G;

switch handles.strC
    case {'Pitch Demand', 'Torque Demand'}
        G = -G;
end
sys = series(C, G);

if ~isempty(hSens)
    set(0, 'CurrentFigure', hSens);
    bode(feedback(tf(1), sys));
end
if ~isempty(hBode)
    set(0, 'CurrentFigure', hBode);
    bode(sys);
end
if ~isempty(hNyquist)
    set(0, 'CurrentFigure', hNyquist);
    nyquist(sys);
end
if ~isempty(hNichols)
    set(0, 'CurrentFigure', hNichols);
    nichols(sys);
end
if ~isempty(hStep)
    set(0, 'CurrentFigure', hStep);
    step(feedback(sys, tf(1)));
end








