language-matlab"><span class="keyword">function</span> [L, dLdm, dLds, S2] = loss_cp(cost, m, s)
</pre><p><b>Input arguments:</b></p><pre class="language-matlab">cost            <span class="string">cost</span> <span class="string">structure</span>
  .p            length <span class="string">of</span> <span class="string">pendulum</span>                              <span class="string">[1 x  1 ]</span>
  .width        array <span class="string">of</span> <span class="string">widths</span> <span class="stri