Double Integral numerically in matlab

5 次查看(过去 30 天)
I am trying to solve a double integral using quadgk. t and r are values that can change so I have created a function where they are inputs.
function BF = calcBF(t, r)
B = @(x,y)(t-x-y)*(3)/(3+4*(x+y)+4*x*y)*sqrt(3)/(sqrt(3+4*(x+y))/r+(4*x*y/r.^2))
firstint = @(x)quadgk(@(y) B(x,y),0,t-x)
secondint = quadgk(@(x) firstint, 0, t)
BF = 6*secondint;
Each time I run the code however, I receive an error that "Supported classes are 'double' and 'single'" I'm sure I'm denoting something wrong within the code; however, I don't see it.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Function Creation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by