Need to solve an singlevariable integral of functions of two variables, and get answers as functions

조회 수: 1 (최근 30일)
Hello and thanks
I've done this before, but now am getting an error like
Error using integralCalc/finalInputChecks (line 522)
Input function must return 'double' or 'single' values. Found 'sym'.
Error in integralCalc/iterateScalarValued (line 315)
finalInputChecks(x,fx);
Error in integralCalc/vadapt (line 132)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 103)
[q,errbnd] = vadapt(@minusInfToInfInvTransform,interval);
when doing
Sol_Mex_P_22 = @(J) abs(integral(@(t) K_mex_p(t).*CC22(t,J),-Inf,Inf));
what is wrong??
thanks!

답변 (1개)

Matt J
Matt J 2020년 5월 6일
This function
@(t) K_mex_p(t).*CC22(t,J)
needs to return a numeric value for every given t. It is returning a symbolic value, however.
  댓글 수: 2
Ori Iger
Ori Iger 2020년 5월 6일
Thanks! I understood that, but how can I solve the integral solely depending on t (from -info to inf so no t remains), and get the answer only as function of J?
I actually did this already, with this same integral function, and it worked great actually. Maybe the J dependence of CC22 is too complicated this time? Uri
Matt J
Matt J 2020년 5월 6일
No, the failure here is because CC22 is a symbolic expression or a symbolic value for J was given as input. All variables participating in this computation must be non-symbolic. If you need to do symbolic integration, then you would use int,

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by