matlab - Weird (I guess) behavior of integral3 -


i trying calculate simple triple integral in matlab using integral3. namely, integral

it easy calculate i=1. however, implement as

f =@(rho, x, y) 8/pi .* rho ; xmin =  0; xmax = 1; rhomin = 0; rhomax = @(x) 2.*(1-x); ymin = 0; ymax = @(x,rho) sqrt(1-(x + rho/2).^2);  integral3(f, xmin, xmax, rhomin, rhomax, ymin, ymax,'method', 'auto'); 

and result 0.499999999999976.

what doing wrong?! in advance.

the order of limits have same order of variable inputs of function, change function definition to

f =@(x, rho, y) 8/pi .* rho ; 

Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -

c# - Get the Class name in a class with atribute inside a attribute method -