%% Disk Margins Based on Sensitivity and Complementary Sensitivity
% diskmargin bases its computation on a shifted sensitivity function S+\left(\sigma -1\right)I/2, where S={\left(I+L\right)}^{-1} is the sensitivity function and σ is the skew parameter. By default, σ = 0, which corresponds to the balanced sensitivity function S-I/2=\left(S-T\right)/2, where  T=I-S is the complementary sensitivity function. Setting σ = 1 computes disk margins based on S, while σ = -1 computes the disk margins based on T. You can try different values of σ and combine the results to obtain less conservative stability margins than you get from the balanced sensitivity function alone.
% Compute margins based on the complementary sensitivity, balanced sensitivity, and sensitivity functions for the system with open-loop transfer function given by
% L=\frac{25}{s^3 +10s^2 +10s+10}\ldotp

L = tf(25,[1 10 10 10]);
DMt = diskmargin(L,-1);
DMb = diskmargin(L); 
DMs = diskmargin(L,1);

%
% Compare the resulting gain margins.

DMt.GainMargin
DMb.GainMargin
DMs.GainMargin

% The different σ values give different ranges for the estimated gain margins. Each of these is a different estimate for the true gain margins, and each guarantees stability for gain variations within its range. Therefore, the closed-loop system is guaranteed to remain stable for all variations in the union of all three ranges, or variations in the open-loop gain of a factor between about 0.51 and about 1.67.
%
% For some systems, larger positive or negative σ values can yield an even larger range of guaranteed stability.

DMneg = diskmargin(L,-100);
DMpos = diskmargin(L,100); 
DMneg.GainMargin
DMpos.GainMargin

% These values extend the range such that stability is guaranteed for gain variations of a factor between about 0.08 and about 1.91.
% For more information about the variation of gain margin estimates with σ, see docid:robust_ug.mw_a81dfae6-e5fb-436c-b6c7-b86e29ca8c2d.
%
% Copyright 2018 The MathWorks, Inc.