MATLAB Answers

Integral2 Error message

6 views (last 30 days)
Kaylee Chavez
Kaylee Chavez on 10 Feb 2021
Answered: madhan ravi on 10 Feb 2021
I am having some difficulty in verifying my answer for an iterated integral. I am looking to solve
>> F = @(x,y) x/y + y/x
F =
function_handle with value:
@(x,y)x/y+y/x
>> q = integral2(F,1,2,1,4)
After running it, I have the following error messages:
Error using integral2Calc>integral2t/tensor (line
241)
Integrand output size does not match the input
size.
Error in integral2Calc>integral2t (line 55)
[Qsub,esub] = tensor(thetaL,thetaR,phiB,phiT);
Error in integral2Calc (line 9)
[q,errbnd] =
integral2t(fun,xmin,xmax,ymin,ymax,optionstruct);
Error in integral2 (line 106)
Q =
integral2Calc(fun,xmin,xmax,yminfun,ymaxfun,opstruct);
>>
Is there a way to fix this? I calculated the actual answer to be about 7.27805.

Accepted Answer

madhan ravi
madhan ravi on 10 Feb 2021
F = @(x,y) x./y + y./x
F = function_handle with value:
@(x,y)x./y+y./x
q = integral2(F,1,2,1,4)
q = 7.2780

More Answers (0)

Community Treasure Hunt

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

Start Hunting!