hi，I now want to use this optimization problem to get the best W, but the result has always been infeasible. Excuse me, what’s wrong with this code？
whatsmore,I change same param such as “ang1”, I could get optimization data.
So I want to know how to deal with it
my program
%%%%%%%%%%%%%
clear all
close all
clc

d_lamda = 0.5;
N_array = 10;%阵列数
N_signal = 1024;% 采样数

lamda = 1;%迭代增益
ksi = -40;%期望旁瓣增益
%%
%角度转换
%%
%扫描角度
thera = [-90:1:90];%切分成181个角度
%期望信号
%偏移量
delta_thera = 12;
angle_m1_thera1 = -delta_thera+ang1
angle_ml = [angle_m1_thera1:1:angle_m1_thera2];%主瓣角度
angle_sl1 = [-90:1:angle_m1_thera1];%旁瓣角度
angle_sl2 = [angle_m1_thera2:1:90];%旁瓣角度
angle_sl = [angle_sl1,angle_sl2];

%%
%信号的导向矢量
%%

%期望信号导向矢量
Desired_VS = VS(ang1,N_array,d_lamda);
%%
%期望的方向图
p = 20*log10((abs(s_VS’Desired_VS/N_array))/max(abs(s_VS’Desired_VS/N_array))); %计算方向图
figure
plot(thera,p);
grid on
hold on
axis([-90 90 -80 5]);
plot([ang1
line([-90 90],[ksi ksi],‘linestyle’,’–’);
plot([angle_m1_thera1 angle_m1_thera1],ylim,‘r:’);
plot([angle_m1_thera2 angle_m1_thera2],ylim,‘r:’);

%%
%最小误差计算
%取主瓣的相关数据
%取对应的矩阵序号
index_ml = find(thera>=angle_ml(1) & thera<=angle_ml(end));%取对应的矩阵序号
%取主瓣的导向矢量
a_ml = s_VS(:,index_ml);
%主瓣期望响应
p_ml = p(index_ml);
%取旁瓣的相关数据
%取对应的矩阵序号
index_sl1 = find(thera>=angle_sl1(1) & thera<=angle_sl1(end));%取对应的矩阵序号
%取旁瓣的导向矢量
a_sl1 = s_VS(:,index_sl1);
%取对应的矩阵序号
index_sl2 = find(thera>=angle_sl2(1) & thera<=angle_sl2(end));%取对应的矩阵序号
%取旁瓣的导向矢量
a_sl2 = s_VS(:,index_sl2);

%旁瓣级总和
index_sl = [index_sl1,index_sl2];
a_sl = [a_sl1,a_sl2];
p_sl = p(index_sl);
%%
%最大旁瓣值
len_sl = length(index_sl);
max_sl=10.^(ksi/20).*ones(1,len_sl);
%期望主瓣响应
p_ml = 10.^(p_ml/20);
%%
cvx_begin
variable w_msl(N_array) complex %权重系数
p_temp=(w_msl’ * s_VS);
%主瓣值
p_temp_ml=p_temp(index_ml);
p_temp_ml=p_temp_ml(:);
%旁瓣值
p_temp_sl=p_temp(index_sl);
%期望值
p_ml=p_ml(:);

%代价函数
minimize(norm(p_temp_ml - p_ml,2)) %最小化2范数 sum(abs(ans).^2)^(1/2)
%约束
subject to
%旁瓣级约束
abs(p_temp_sl) <= max_sl;
%权重约束
w_msl’*Desired_VS == 1;
norm(w_msl,2) <= (1/N_array);
cvx_end

pmvdr_beam_response = w_msl’*s_VS;

figure
plot(thera,20log10(abs(pmvdr_beam_response)/max(abs(pmvdr_beam_response))));
grid on
hold on
axis([-90 90 -70 5]);
plot([ang1
line([-90 90],[ksi ksi],‘linestyle’,’–’);
plot([angle_m1_thera1 angle_m1_thera1],ylim,‘r:’);
plot([angle_m1_thera2 angle_m1_thera2],ylim,‘r:’);

some message is this

## Calling SDPT3 4.0: 707 variables, 180 equality constraints For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 180
dim. of socp var = 546, num. of socp blk = 160
dim. of linear var = 159
dim. of free var = 2 *** convert ublk to lblk

SDPT3: Infeasible path-following algorithms

## number of iterations = 31 residual of dual infeasibility certificate X = 4.22e-13 reldist to infeas. <= 1.21e-15 Total CPU time (secs) = 1.22 CPU time per iteration = 0.04 termination code = 2 DIMACS: 4.3e-02 0.0e+00 9.4e-01 0.0e+00 -1.0e+00 4.1e-01

Status: Infeasible
Optimal value (cvx_optval): +Inf

Follow the advice at https://yalmip.github.io/debugginginfeasible , all of which, except for section 1, also applies to CVX.