I am getting error in integrating a function from 0 to infinity wrt x. Kindly help.
3 次查看(过去 30 天)
显示 更早的评论
CODE:
fun=@(x) (p*q*r*exp(-x*d/sqrt(a*b)));
rx=integral(fun,0,Inf)
Msq=pi*u*sqrt(a*b)*rx
% where variables p, q, r, d, a and b are defined
ERROR:
Error using *
Inner matrix dimensions must agree.
Error in @(x)(p*q*r*exp(-x*d/sqrt(a*b)))
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 83)
[q,errbnd] = vadapt(@AToInfInvTransform,interval);
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
Error in SaadMutashar (line 83)
rx=integral(fun,0,Inf)
3 个评论
Andrei Bobrov
2019-1-24
编辑:Andrei Bobrov
2019-1-24
What is p, q, r, d, a and b? Please attach mat-file with your variables.
采纳的回答
Andrei Bobrov
2019-1-24
Try
q = integral(fun,0,Inf,'ArrayValued',1);
but in your case the result is a zero vector, due to value of the gamma = 0.
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gamma Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!