How can I integrate this function?
1 次查看(过去 30 天)
显示 更早的评论
c= 299792458; %speed of light
%h(J.s)=6.62607004*10^(-34); %Planck's constant
h_ev = 4.14*10^(-15); %eV.s %Planck's constant
l = linspace(1*10^-5,3*10^-7,5000);
E = ((h_ev*c)./l);
%k= 1.38064852 * 10^(-23); %J/K %boltzmann constant
k_ev= 8.62*10^-5; %eV/K
E_g= 0;
u=0;
q = 1.602176462*10^-19;
%planck = @(T)(heaviside(E-E_g).*(2*pi/(c^2*h_ev^3).*((E.^2)./(exp(E-u))./(k_ev*T))-1));
planck2 = @(T)(2*pi/(c^2*h_ev^3)).*((E.^2)./(exp((E-u)./(k_ev.*T))-1));
planckint = integral(planck2,0,5780)
The function evaluates correctly but I cant integrate it
Matrix dimensions must agree.
Error in Untitled2>@(T)(2*pi/(c^2*h_ev^3)).*((E.^2)./(exp((E-u)./(k_ev.*T))-1))
Error in integralCalc/iterateScalarValued (line 314)
fx = FUN(t);
Error in integralCalc/vadapt (line 132)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 75)
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
Error in Untitled2 (line 13)
planckint = integral(planck2,0,5780)
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!