Does anyone know how to modify the error (Disciplined convex programming error: Illegal operation: pow_p( {convex}, {-1} ))

29 次查看(过去 30 天)
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 个评论
Adam
Adam 2019-2-14
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?
yang-En Hsiao
yang-En Hsiao 2019-2-14
we don't need to define cvx,cvx is like a tool in matlab ,but you have to install it .
http://cvxr.com/cvx/doc/index.html

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by