close all
frequency = 3e9;
lambda = 3e8/frequency;
antenna_spacing = [lambda/4,lambda/2,lambda*2/3,lambda];
x_number_total = floor(2*3*lambda./antenna_spacing); y_number_total = floor(2*3*lambda./antenna_spacing);

for z_iter = 1:length(antenna_spacing)
    x_number = x_number_total(z_iter);
    y_number = y_number_total(z_iter);
axis = cell(x_number*y_number,1);
for i = 1:x_number
    for j = 1:y_number
            axis{(i-1)*y_number+j} = [i*antenna_spacing(z_iter),j*antenna_spacing(z_iter)];
    end
end

[kernel_matrix] = kernel_calculate(frequency,axis,"solid_circle");

eigen_value = eig(kernel_matrix);
eigen_value = flip(eigen_value);


eigen_value = eigen_value/eigen_value(1);

if(z_iter==1)
    plot(1:5:200,eigen_value(1:5:200),'-s','color','red','Linewidth',1.5,'markersize',4)
elseif(z_iter==2)
    hold on
    plot(1:5:length(eigen_value),eigen_value(1:5:end),'-o','color','m','Linewidth',1.5,'markersize',4)
elseif(z_iter==3)
    hold on
    plot(1:5:length(eigen_value),eigen_value(1:5:end),'-+','color','green','Linewidth',1.5,'markersize',4)
elseif(z_iter==4)
    hold on
    plot(1:5:length(eigen_value),eigen_value(1:5:end),'-^','color','blue','Linewidth',1.5,'markersize',4)
end
end
grid on
xlabel('Eigenvalue Index','Interpreter','latex','FontSize',14);
ylabel('Eigenvalue','Interpreter','latex','FontSize',14);
legend('$\lambda/4$','$\lambda/2$','$2\lambda/3$','$\lambda$','Interpreter','latex')