;
  s = randn(d); s = s*s';
  policy.maxU = <span class="string">'2 3'</span>;
  policy.fcn = @(policy, m, s)conCat(@conLin, @gSat, policy, m, s);
<span class="keyword">end</span>

D = length(policy.maxU);
d = length(m);

<span class="keyword">switch</span> deriv
  <span class="keyword">case</span> <span class="string">'dMdm'</span>
      [dd dy dh] = checkgrad(@conT0, m, delta, policy, s);

  <span class="keyword">case</span> <span class="string">'dSdm'</span>
      [dd dy dh] = checkgrad(@conT1, m, delta,