Numerical evaluation of multiple integral not working
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Numeric Solvers dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!