Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

what is wrong with this code?

1 Ansicht (letzte 30 Tage)
Atrolita afra
Atrolita afra am 31 Mär. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
functiony=pdf_rician(k,c,sigma)
%% pdf of process of various values of system parameters
for x=0:0.0625:10
temp=0;
pdf_rici=0;
for p=0:10
for n=0:(p+1)
% closed term expansion
b=nchoosek(p+0.5,n);
% gamma term calculation
f=factorial(p);
g=(gamma(p+1))*(gamma(c));
g_ma= 2*sqrt(2)*sqrt(pi)*((x.^(2*p+1))*(k.^c))/((sigma.^(p+0.5))*g*f);
% bessel function term calculation
z=2*sqrt(k*(sigma+x.^2)/sigma);
K = besselk(p-n+c,z);
% Exponential term calculation
exponential=exp(-x.^2/sigma);
% Last term
q=(p-n+c)/2;
last_term=((k*sigma/(sigma+(x.^2))).^q);
% Final pdf function
temp1= b*g_ma*K*exponential*last_term;
temp=temp+temp1;
end
pdf_rici=pdf_rici+temp;
end
y(1,x/(.0625)+1)=pdf_rici;
end
  2 Kommentare
Walter Roberson
Walter Roberson am 31 Mär. 2020
What leads you to say there is a problem with the code? Is there an error message?
Atrolita afra
Atrolita afra am 31 Mär. 2020
yes i could not get the figure and there was an error message syaing,"" Matrix dimensions must agree.

Antworten (1)

Jamal Nasir
Jamal Nasir am 31 Mär. 2020
the variable temp1 is not single value. it is a vector so need to check the equation
  1 Kommentar
Atrolita afra
Atrolita afra am 31 Mär. 2020
here is the equation,that i am trying to plot

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by