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

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