                       <span class="comment">% dMdp</span>
policy.p = p;
<span class="keyword">if</span> nargout &lt; 2
    M = policy.fcn(policy, m, s);
<span class="keyword">else</span>
    [M, S, C, dMdm, dSdm, dCdm, dMds, dSds, dCds, dMdp] = policy.fcn(policy, m, s);
    df = dMdp;
<span class="keyword">end</span>
f = M;

<span class="keyword">function</span> [f, df] = conT7(p, policy, m, s)
policy.p = p;
<span class="keyword">if</span> nargout &lt; 2
    [M, S] = policy.fcn(policy, m, s);
<span class="