%% Determine Disk Size and Skew from Disk-Based Gain Margin
% Determine the disk size and skew needed to capture gain variations between 80% and 150% of nominal and phase variation between –20 and +40 degrees. First, use getDGM to find DGM = [gmin,gmax] that describes a disk that captures these target ranges.

DGM = getDGM([0.8,1.5],[-20,40],'tight')

% Now use gm2dm to convert that disk-based gain variation into the α,σ parameterization of the disk.

[alpha,sigma] = gm2dm(DGM)

% For the modeled gain and phase variations, the skew is less than zero because the disk-based gain range DGM = [0.2 1.5] includes more gain decrease than increase.

diskmarginplot(alpha,sigma,'disk')

% Copyright 2019 The MathWorks, Inc.