代码已贴,索引超处数组边界怎么修改。
5 views (last 30 days)
Show older comments
果博东方开户中心【微8785092】
on 23 May 2023
Answered: 果博东方开户热线【微8785092】
on 23 May 2023
clear all;
theta=70;
m=-log10(2)/log10(cosd(theta));
P_LED=1;
nLED=60;
P_total=nLED*nLED*P_LED;
Ar=1;
Ts=1;
index=1.5;
FOV=70;
G_Con=(index^2)/(sind(FOV).^2);
rho=0.7;
B=100;
Ibg=5100;
gama=1.5;
Tk=298;
G=10;
eta=112;
gm=30;
I2=0.562;
I3=0.086;
q=1.602176487E-19; %电子电荷量
k=1.380649e-23;
R=0.55; %光电转换系数
lx=10;
ly=10;
lz=3;
h=3;
%1个LED的位置
T1=[2,8,h];
Nx=lx*2.5;
Ny=ly*2.5;
Nz=lz*5;
dA=lz*ly/(Ny*Nz);
x=linspace(0,lx,Nx);
y=linspace(0,ly,Ny);
z=linspace(0.2,lz,Nz);
[XR,YR]=meshgrid(x,y);
D1=sqrt((XR-T1(1,1)).^2+(YR-T1(1,1)).^2+h.^2);
cosphi_A1=h./D1;
receiver_angle=acosd(cosphi_A1);
H_A1=(m+1)*Ar.*cosphi_A1.^(m+1)./(2*pi.*D1.^2);
P_rec_A1=P_total.*H_A1.*Ts.*G_Con;
P_rec_A1(find(abs(receiver_angle)>FOV))=0;
P_rec_total=P_rec_A1;
P_rec_dBm=10*log10(P_rec_total);
figure(1)
surfc(x,y,P_rec_dBm);
zlabel('LOS接收光功率分布/dB');
0 Comments
Accepted Answer
果博东方开户热线【微8785092】
on 23 May 2023
因为前面定义k=3,所以
h1(ii,jj)=h(ii,jj)+(m+1)*Ar*rho*dA*cos_phi^m*cos_alpha*cos_beta*cos_psi/(2*pi^2*D1^2*D2^2);索引失败
在for嵌套循环前加了一句h=3*ones(25,25);或者这句代码中h(ii,jj)应为h1(ii,jj)
还有报错p_total未定义
个人见解,仅供参考
0 Comments
More Answers (0)
See Also
Categories
Find more on 显示和探查 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!