hi. i am new here. can someone help me out here. there are errors in my code. can someone fix them
1 次查看(过去 30 天)
显示 更早的评论
function H = FF(I)
%segma_N=10.^-7;
a = 2; %Alpha
b = 2; %Beta
c = 0.2; %Gamma
d = 0.8; %Big omega prime
k = 1;
z = 4; %Propagation Distance
%segma_db = 8; %Atmospheric attenuation coefficient
segma = (8*0.115129255);
p_db =0:1:30; %power
p = 10.^(p_db/10);
%R = 0.5; %Optoelectronic conversion factor
s = 0.3; %Zero boresight
I1 = exp(-segma*z); %Atmospheric attenuation
Aperture_radius = 0.1; %Aperture_radius
segma_s = 0.2; %Jitter standard deviation
omega_z = 2.5; %Beam Width
v = (sqrt(pi)*Aperture_radius)/(sqrt(2)*omega_z);
omega_zeq = sqrt((omega_z.^2*(sqrt(pi)*erf(v)))/(2*v*exp(-v.^2)));
g = omega_zeq/(2*segma_s);
A = ((2*a.^(a/2))/(c.^(1+a/2)*gamma(a)))*(((c*b)/(c*b+d)).^(b+a/2));
A0 = (erf(v)).^2;
ak = (nchoosek(b-1,k-1))*(((c*b+d).^(1-k/2))/gamma(k))*((d/c).^(k-1))*((a/b).^(k/2));
%% for plus part
g0 = (((a*b*I)./((c*b+d)*A0*I1)).^(p-(a-k)./2))./(gamma(p-(a-k)+1)*factorial(round(p)));
m0 = (-omega_zeq.^2)./(4*(p+k-g.^2));
e0 = exp(((-omega_zeq.^2)*s.^2)./(8*(p+k-g.^2)*segma_s.^2));
%% for minus part
g1 = (((a*b*I)./((c*b+d)*A0*I1)).^(p+(a-k)./2))./(gamma(p+(a-k)+1)*factorial(round(p)));
m1 = (-omega_zeq.^2)./(4*(p+a-g.^2));
e1 = exp(((-omega_zeq.^2)*s.^2)./(8*(p+a-g.^2)*segma_s.^2));
%%for inside summation
p = 0:p;
s0 = sum((g0*m0*e0)-(g1*m1*e1));
%final summation
k = 1:b;
term1 = (ak.*I.^((a+k)./(2-1)))./(((A0.*I1).^((a+k)/2)).*sin(pi*(a-k)));
final = term1*s0;
s1 = sum(final);
% final returnb equation
H = ((2*pi*g.^2*A*exp((-s.^2)./(2*segma_s.^2)))./(omega_zeq.^2))*s1;
end
2 个评论
David Hill
2020-8-31
What is the input, I? Equations for g0 and g1 do not work. p is a 1x31 array with final element 1000. factorial(1000) will not work. What are you trying to do here, p=0:p?
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!