Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to supply a function elementwise to Integral2

1 回表示 (過去 30 日間)
Kolibris
Kolibris 2013 年 3 月 21 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi guys,
I want to evaluate a double integral of the form int_{-inf}^a int_{-inf}^b sum_{i,j}^K a_i*a_j*x^i*y^j*exp(-x^2 - y^2 + x*y)dx dy where a_i and a_j are constants. Since the integral is linear, I can change summation and integration, but in this case I have to evaluate K^2 integrals and it takes too long. In that case I do the following:
for i = 1:K
for j = 1:K
fun = @(x,y) x.^i.*y.^j.*exp(-2.*(x.^2 + y.^2 - 2.*x.*y))
part(i,j) = alpha(i)*alpha(j)*integral2(fun,-inf,a,-inf,b)
end
end
It takes too long, so I want to evaluate only one integral, but I don't know how to factorize sum_{i,j}^K a_i*a_j*x^i*y^j*exp(-x^2 - y^2 + x*y), namely, how to supply it to integral2. | would be very grateful for any help.
Kind regards, Renata

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by