CS计算机代考程序代写 clear all

clear all
clc

arph_set=[0,0.5,1,1,2];
beta_set=[0,0.5,1,2,3];
P=20;%transmit power
N0=1;%spatial power spectral density N0
z0=4;% user location
A=(0.05:0.5:400);% IRS surface area
C=zeros(length(arph_set),length(A));
for i=1:length(arph_set)
arph=arph_set(i);
beta=beta_set(i);
N_=N0+4.^(beta-1).*P.*arph.*A.^(2.*beta)./((beta+1).*z0^2.*pi.^(beta+1));% effective noise density with HWI
tau=A./z0;
cita=1./pi.*atan(tau.^2./(sqrt(2.*tau.^2+1)));
C(i,:)=log2(1+cita.*P./N_);% calculate capacity
end
figure(1)
sizeType={‘^’,’<','*','o','s'}; Color = linspecer(size(C,1)); for i=1:size(C,1) semilogx(A',C(i,:)','-','LineWidth',1.5,'color',Color(i,:),'marker',sizeType{i}); hold on end xlabel('Surface-area A[m^2]') ylabel('Capacity [nats/s/Hz]') legend('w/o HWI','w. HWI,\alpha=\beta=0.5','w. HWI,\alpha=\beta=1','w. HWI,\alpha=1,\beta=2','w. HWI,\alpha=2,\beta=3','Location','northwest'); grid on