Répondre

0

Si vous voulez faire l'intégration avec deux variables, vous devez utiliser integral2.

Un exemple avec deux variables:

fun = @(x,y) 1./(sqrt(x + y) .* (1 + x + y).^2); 
ymax = @(x) 1 - x; 
q = integral2(fun,0,1,0,ymax) 

q = 
    0.2854 

Si vous voulez plusieurs paramètres, et deux variables font:

fun = @(x,y,c,d) c./(sqrt(x + d*y) .* (1 + x + y).^2); 
ymax = @(x) 1 - x; 
q = integral2(@(x,y) fun(x,y,3,4),0,1,0,ymax) 

q = 
0.5708 

Ou simplement:

c = 3; d = 4; 
fun = @(x,y) c./(sqrt(x + d*y) .* (1 + x + y).^2) 
ymax = @(x) 1 - x; 
q = integral2(fun,0,1,0,ymax) 

q = 
    0.5708