Recently,I’m coding but I meet the problem:

Disciplined convex programming error:

Cannot perform the operation: {real affine} ./ {real affine}

My code is shown as following,I don’t know where is wrong, and I’m very confused now…

clear all;

clc;

%%

K = 30;

T=[20:10:200]*1e-3;

F = 6e9;

N_0 = 1e-9;

B = 10e6;

beta = ones(1,K);

R = randi([100,500],K,1);

C = randi([500,1500],K,1);

P = unifrnd(0,20e-11,K,1);

F_K = unifrnd(0.1,1.0,K,1);

h = exprnd(1e-6,K,1);

% l = zeros(1,K);

% t = zeros(1,K);

%%

m = R - (T*F_K)./C;

m_plus = max(m,0);

%%

Prameters.K = K;

Prameters.F = F;

Prameters.N_0 = N_0;

Prameters.B = B;

Prameters.R = R;

Prameters.C = C;

Prameters.P = P;

Prameters.F_K = F_K;

Prameters.h = h;

Prameters.m_plus = m_plus;

%%

for i = 1:length(T)

Prameters.T = T(i);

[Solution,obj_E] = my_cvx(Prameters);

obj(i) = obj_E;

end

function [Solution,obj_E] = my_cvx(Prameters)

%%

K = Prameters.K;

T = Prameters.T;

F = Prameters.F;

N_0 = Prameters.N_0;

B = Prameters.B;

R = Prameters.R;

C = Prameters.C;

P = Prameters.P;

F_K = Prameters.F_K;

h = Prameters.h;

m_plus = Prameters.m_plus;

%%

cvx_clear;

cvx_solver Mosek % Gurobi Mosek

cvx_precision high;

%% CVX_Solution

cvx_begin

variable l(K,1);

variable t(K,1);

```
%% objective function
obj_E = cvx(0);
for k = 1:K
obj_E = obj_E + (t(k)./h(k)).* (f(l(k)./t(k))) + (R(k)-l(k)).*C(k).*P(k);
end
obj_E = sum(obj_E);
%% minimize
minimize(obj_E)
%% constrains
sum(t) <= T;
sum (C'*l) <= F;
t >= 0;
m_plus <= l <= R;
```

cvx_end

%% Solutions

Solution.l = l;

Solution.t = t;

end