This is my code:
function [L_,P_] = location_Optimal(K,W,H_IC,CC,H_height,I_L,Beta,H_uc,H_iu,P_max,rou,Theta,UAV,p);
cvx_solver mosek
cvx_begin
cvx_quiet false;
variable L(1,2)
variable P(K)
expression I2(K)
expression I3(K)
for i=1:K
s_inter = 0;
for j =1:K
if i ==j
continue
else
s_inter = p(j).*pow_abs((W(:,i)'*H_IC(:,j))+rou*sqrt(1./((real(H_height.^2)+square_pos(norm(L-CC)))...
*pow_abs(real(H_height.^2)+square_pos(norm(L-I_L(j,:))),(Beta/2)))).*W(:,i)'*H_uc'*Theta*H_iu(:,j),2)+s_inter;
end
end
I2(i) = log(real(s_inter+B*N_0))/log(2);
This is the error:
Disciplined convex programming error:
Illegal operation: pow_abs( {convex}, {1.25} )
function y = pow_abs( x, p )
%POW_POS Power of absolute value.
% POW_POS(X,P) = ABS(X).^P.
% P must be real and greater than or equal to one.
%
% Disciplined convex programming information:
% POW_ABS(X,P) is convex and nonmonotonic, so X must be affine.
% P must be constant, and its elements must be greater than or
% equal to one. X may be complex.
I checked the introduction of the pow_abs function and found that there is no problem with my code, p can be a decimal, how can I change my code to make it work correctly?