I am having problems with calculating my integral:
f10 = @(x,a) x^2*exp(-x^2/(2*a^2))
q10 = integral(f10,-Inf,Inf,'ArrayValued',true)
This is the error message I get after running it:
Not enough input arguments.
Error in @(x,a)x^2*exp(-x^2/(2*a^2))
Error in integralCalc/iterateArrayValued (line 156)
fxj = FUN(t(1)).*w(1);
Error in integralCalc/vadapt (line 130)
[q,errbnd] =
iterateArrayValued(u,tinterval,pathlen);
Error in integralCalc (line 103)
[q,errbnd] =
vadapt(@minusInfToInfInvTransform,interval);
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
>>

 채택된 답변

madhan ravi
madhan ravi 2019년 2월 25일

0 개 추천

f10 = @(x,a) x.^2.*exp(-x.^2./(2*a.^2))
q10 = integral(@(x)f10(x,2),-Inf,Inf)
% ^--- value of a
% otherwise use integral2() if you want to integrate with respect to x and a.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Partial Differential Equation Toolbox에 대해 자세히 알아보기

제품

릴리스

R2016b

질문:

2019년 2월 25일

답변:

2019년 2월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by