nt">% exponent powers</span>
pwi = g2 -1;
pwj = 1+g1-g2;

<span class="comment">% optimization variables</span>
cvx_begin <span class="string">gp</span>
  variables <span class="string">v(M)</span> <span class="string">y(M)</span> <span class="string">w(M)</span>

  <span class="comment">% objective function is the base transmit time</span>
  tau_B = C*w(1);

  minimize( tau_B )
  subject <span class="string">to</span>
    <span class="comment">% problem constraints</span>
    v &gt;= Nmin;
    v &lt;= Nmax