%% Worst-Case Disk Margin Plot with Customized Appearance
% Plot the worst-case disk margins as a function of frequency of a system with the following open-loop response.

a  = ureal('a',10,'PlusMinus',[-4,4]);
L = tf(25,[1 a a a]);

%
% For the plot, use the default preferences specified in your Control System Toolbox preference, except specify the following attributes:
% Frequency units: Hz
% Gain margins on a log scale, in absolute units
% Grid on

opts = diskmarginoptions('cstprefs');
opts.FreqUnits = 'Hz';
opts.MagScale = 'log';
opts.MagUnits = 'abs';
opts.grid = 'on';

w = {2*pi*1e-3,2*pi*10};   % rad/s
wcdiskmarginplot(L,w,opts)

% The plot you obtain might differ in appearance, depending on your current Control System Toolbox preference settings. (See Toolbox Preferences Editor.)
%
% Copyright 2019 The MathWorks, Inc.
%