I looped 20 times cvx to solve the optimization vector w, of which FI is weighted by w. After the first solution, it was NAN, and then the error was reported.
c=0; FI=ones(n,1);
%optimization
for l=1:20
cvx_begin
variable w(n,1) complex
for ll = 1:n
c=abs(w(ll))*FI(ll)+c; % 累加每次循环中的计算结果
end
minimize(c)
subject to
for i=1:length(ind)
real(As(:,i).'*w)<=10^(-30/20);
end
for ii=1:length(inm)
real(Am(:,ii).'*w)>=10^(-0.4/20);
real(Am(:,ii).'*w)<=0
end
Dear Mr. Mark, may I ask if my code is convex?FI=ones(n,1);
cvx_begin
variable w(n,1) complex
minimize( abs(w.')*FI)
subject to
for i=1:length(ind)
real(As(:,i).'*w)<=10^(-30/20);
end
for ii=1:length(inm)
real(Am(:,ii).'*w)>=10^(-0.4/20);
real(Am(:,ii).'*w)<=0;
end