syms g;
I0_dBm=-12:22;
for jj=1:length(I0_dBm)
var_ni(jj)=(6.09*10^-10*(10^(I0_dBm(jj)/10))*g)+(8.28*10^-14);
fun(jj)=(1/4)*(2.02*10^7)*1.3844*(g^(2.1417))*exp(-(10* (10^(I0_dBm(jj)/10))*(10^-3)*g/(2*sqrt(var_ni(jj))))^2)*erfc((log(g/(0.0068))+0.1821)/sqrt(0.1));
ber(jj)=sym(int(fun(jj),g, 0, Inf));
end
figure
semilogy(I0_dBm,ber,'g-d','LineWidth',2);
I tried this integration but the error is-
  • Error using semilogyConversion to double from sym is not possible.*

 채택된 답변

Torsten
Torsten 2018년 7월 5일

0 개 추천

I0_dBm=-12:22;
for jj=1:length(I0_dBm)
var_ni=@(g)(6.09*10^-10*(10^(I0_dBm(jj)/10))*g)+(8.28*10^-14);
fun=@(g)(1/4)*(2.02*10^7)*1.3844*(g.^(2.1417)).*exp(-(10* (10^(I0_dBm(jj)/10))*(10^-3)*g./(2*sqrt(var_ni(g)))).^2).*erfc((log(g/(0.0068))+0.1821)/sqrt(0.1));
ber(jj)=integral(fun, 0, Inf);
end
figure
semilogy(I0_dBm,ber,'g-d','LineWidth',2);

댓글 수: 5

Pritam Sahoo
Pritam Sahoo 2018년 7월 5일
Thank you Sir for your valuable time. I have tried your answer, but the present error is-
_ Nonscalar arrays of function handles are not allowed; use cell arrays instead._ Error in (line 146) var_ni(jj)=@(g)(6.09.*10.^-10.*(10.^(I0_dBm(jj)./10)).*g)+(8.28.*10.^-14);
Torsten
Torsten 2018년 7월 5일
Where did you see var_ni(jj) in my code ?
Pritam Sahoo
Pritam Sahoo 2018년 7월 5일
Thank you very much Sir. I am very sorry. Can I have your name, affiliation and email ID. I think, if you have not any prolem i'll add your name as an author in my paper.
Torsten
Torsten 2018년 7월 5일
That's very good of you, but not necessary.
Best wishes
Torsten.
Pritam Sahoo
Pritam Sahoo 2018년 7월 5일
Thank You Sir.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

2018년 7월 5일

댓글:

2018년 7월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by