%% Weighted Constraint on H2 Norm
% Create a constraint for a transfer function with one input, r, and two outputs, e and y, that limits the H_{2} norm as follows:
% {\left\| {\begin{array}{c}
% { \displaystyle \frac{1}{s + 0.001}T_{re}}\\[1.75ex]
% { \displaystyle \frac{s}{0.001s + 1}T_{ry}}
% \end{array}} \right\|_2} < 1.
% T_{re} is the closed-loop transfer function from r to e, and T_{ry} is the closed-loop transfer function from r to y .

s = tf('s');
WL = blkdiag(1/(s+0.001),s/(0.001*s+1));
Req = TuningGoal.WeightedVariance('r',{'e','y'},WL,[]);

% Copyright 2012 The MathWorks, Inc.