Numerical Integration at different point

2 views (last 30 days)
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.*

Accepted Answer

Torsten
Torsten on 5 Jul 2018
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 Comments
Torsten
Torsten on 5 Jul 2018
That's very good of you, but not necessary.
Best wishes
Torsten.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!