Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How to supply a function elementwise to Integral2

1 visualización (últimos 30 días)
Kolibris
Kolibris el 21 de Mzo. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by