MATLAB: Evaluating numerical value of symbolic integral

intintegral

I need numerical value of Eb_avg, instead matlab is giving symbolic expression and is not performing the integrals
Following is my code:
clc;
clear all;
close all;
neta=0.75;
rho=0.5;
T=1e-3;
P_No_dB=15;
P_No_end=size(P_No_dB);
in=P_No_end(1,2);
P=10.^(P_No_dB./10);
sigma_sq=1;
Ebmax=100*1e-3;
d0=1;
m=3;
var_hsd=(d0^(-m));
d1=2;
m=3;
var_hse=(d1^(-m));
d2=2;
m=3;
var_hed=(d2^(-m));
R=2;
SNRth=2^R;
count=0;
beta=(2^R-1).*sigma_sq./(P.*(1-rho));
lambda_0=1/(var_hsd);
lambda_1=1/(var_hse);
lambda_2=1/(var_hed);
Eb=[];
for j=1:in
syms x y
fun=(T*lambda_2.*((x-y.*(1-rho))./(y.*(1-rho))).*sigma_sq.*( expint(lambda_2.*(T.*(x-y.*(1-rho)).*sigma_sq)./(y.*(1-rho).*(T.*neta.*rho.*P.*y +Ebmax))) -expint(lambda_2.*((x-y.*(1-rho)).*sigma_sq)./(y.*(1-rho).*(neta.*rho.*P.*y))) ) -T.*neta.*rho.*P.*y.*( exp(-lambda_2.*(T.*(x-y.*(1-rho)).*sigma_sq)./(y.*(1-rho).*(T.*neta.*rho.*P.*y +Ebmax))) - exp(-lambda_2.*((x-y.*(1-rho)).*sigma_sq)./(y.*(1-rho).*(neta.*rho.*P.*y))) )).*lambda_1.*lambda_0.*exp(-lambda_1.*y).*exp(-lambda_0.*x);
fun1=int(fun,y,beta,x/(1-rho));
Eb_avg=int(fun1,x,0,Inf);
Eb=[Eb Eb_avg];
count=count+1
end

Best Answer

change both int() into vpaintegral().
You have a function in two variables, and it does not look to have a closed form in either of the two variables individually, so the first int() is going to return unresolved. It looks like MATLAB is not able to find a closed form for the 2D integral. So switch to numeric integration on formulae by using vpaintegral()
Note: make sure you replace both int() calls.
... It still won't be fast. Integrating to infinity seldom is.