I am trying to solve a geometric problem with the CVX MATLAB package. The issue is that the running time increases with each iteration of for loop.

What should I do?

## The example code is the following:

M=100;K=40;

G = rand(M,K);

cvx_begin

variable x(M,K)

minimize(0)

subject to

for i =1:20

tic

for k=1:K

Ax = (G(:,k).*sqrt(x(:,k)));

end

toc

clear Ax

end

cvx_end

## And the output is as follows:

Elapsed time is 1.951600 seconds.

Elapsed time is 1.865454 seconds.

Elapsed time is 1.795588 seconds.

Elapsed time is 2.279985 seconds.

Elapsed time is 2.587530 seconds.

Elapsed time is 2.747588 seconds.

Elapsed time is 3.706303 seconds.

Elapsed time is 4.140957 seconds.

Elapsed time is 5.138583 seconds.

Elapsed time is 5.138122 seconds.

Elapsed time is 6.959450 seconds.

Elapsed time is 7.754655 seconds.

Elapsed time is 8.494337 seconds.

Elapsed time is 24.810320 seconds.

Elapsed time is 25.497016 seconds.

Elapsed time is 25.820188 seconds.

Elapsed time is 28.247370 seconds.

Elapsed time is 30.909417 seconds.

Elapsed time is 29.220745 seconds.

Elapsed time is 29.382676 seconds.