00    1.0100;
     0.5000    0.9300    0.9500    1.0400    1.0100;
     3.5000    0.9900    0.9700    0.9800    1.0100];

[m,n] = size(P);
Pi = ones(m,1)/m;
x_unif = ones(n,1)/n; <span class="comment">% uniform resource allocation</span>

<span class="comment">% Find the log-optimal investment policy</span>
cvx_begin
    variable <span class="string">x_opt(n)</span>
    maximize <span class="string">sum(Pi.*log(P*x_opt))</span>
    sum(x_opt) == 1
    x_opt &gt;= 0
cvx_end

<span class="comment">% Long-term