Numerical evaluation of multiple integral not working
Mostrar comentarios más antiguos
Hi guys,
I'm trying to numerically calculate the integral after Equation (1) from here: Distances In Bounded Regions
The final purpose is to calculate the average distance between all points in a region.
The result of the integral should be 0.5214.
I'm calculating it by calling integral2 function like this:
clear all;
f = @(theta,r)(1-r.*sin(theta)).*(1-r.*cos(theta)).*r.^2;
ymax = @(theta)1./cos(theta);
xmax = pi/8;
8*integral2(f, 0, xmax, 0, ymax)
However I'm getting the wrong answer. What's the problem with my code?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Numeric Solvers en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!