Double Integral numerically in matlab

5 Ansichten (letzte 30 Tage)
Brittany
Brittany am 9 Dez. 2014
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.

Antworten (0)

Kategorien

Mehr zu Function Creation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by