Does anyone know how to modify the error (Disciplined convex programming error: Illegal operation: pow_p( {convex}, {-1} ))
29 views (last 30 days)
Show older comments
i write a cvx code by using matlab ,and the window show me a error ,but i don't know its meaning and how do i modify my code
The window show me as below
Error using cvx/pow_cvx (line 144)
Disciplined convex programming error:
Illegal operation: pow_p( {convex}, {-1} )DO
Error in cvx/inv_pos (line 5)
y = pow_cvx( x, -1, 'pow_p' );
Error in f_kI (line 53)
denominator=inv_pos(total+nois_var_ak_2pow(1) + nois_var_dk_2pow(1))
And my code is as below
bar_r=[10 10 10 10];
P_T=10;
h_1=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_2=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_3=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_4=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_kk=cat(2,h_1 ,h_2 ,h_3, h_4)
for n=1:4
h_k{n}=h_kk(1:4 , n);
n=n+1;
end
%===========================================================
cvx_begin
variable f_kiii(N,1,K);
f_kii=cat(2, f_kiii)
for o=1:4
f_ki{o}=f_kii(1:4,o)
end
op2=0;
for k=1:K
op2=op2+square_abs(f_ki{k});
end
%==========================================
%objected function
minimize( op2 )
subject to
%==========================================
%c8
total = 0;
for k = 1:K
sub_denominator = 0;
for j = 1:K
if j ~= k
sub_denominator = sub_denominator + square_abs(h_k{k}' * f_ki{j});
end
end
total = total + sub_denominator;
end
numerator=square_abs(h_k{k}' *f_ki{k})
denominator=inv_pos(total+nois_var_ak_2pow(1) + nois_var_dk_2pow(1))
numerator*denominator>=bar_r(1)
cvx_end
Does anyone know how to modify the error code?
denominator=inv_pos(total+nois_var_ak_2pow(1) + nois_var_dk_2pow(1))
4 Comments
Adam
on 14 Feb 2019
It still isn't defined anywhere. And what is cvx? If you don't give all the relevant information people can't provide useful help without just making guesses. You haven't added any tags other than Matlab to give an idea what domain it is related to. Are we supposed to all know what cvx is?
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!