MATLAB: Numerical integral over the whole spherical volume of a crystallite

integrationnumerical integrationspherical volumetriple integration

I am new to matlab. I want to solve the above equation to get the total carrier concentration in the spherical grain volume;
below are the values of the parameters:
Total Volume of the sphere= 4/3*pi*r^3
r= 40*10^-9 %meters
Ld= 18*10^-9 %meters
phi= 20
Nd= 1e23

Best Answer

Nd = 1e23;
phi = 20;
Ld = 18e-9;
R = 40e-9;
fun = @(r) 4*pi*r.^2.*(1-exp(phi + 1/6*(r/Ld).^2));
value_integral = Nd*integral(fun,0,R)