Double Integral numerically in matlab

3 ビュー (過去 30 日間)
Brittany
Brittany 2014 年 12 月 9 日
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 Center および File ExchangeFunction Creation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by