double integral in MATLAB, limits as variable?
28 views (last 30 days)
Show older comments
Hi, Is it possible to do a double integral in MATLAB numerically, where limits are functions of variables?
Say my integrand is x*y dy * dx
limits are y=0 to 5x
x = 0 to 5
I can manage this by
syms x y
double(int(int(x*y,y,0,5*x),x,0,5))
But, I think, this is clumsy way. This will get worse for triple integrals. Is there any direct function where we can put limits directly with limits even including variables?
0 Comments
Answers (1)
madhan ravi
on 6 Jul 2018
fun = @(x,y) x.*y;
xmin = 0;
xmax = 5;
ymin = 0;
ymax = @(x) 5*x;
Q = integral2(fun,xmin,xmax,ymin,ymax,'Method','tiled')
0 Comments
See Also
Categories
Find more on Number Theory in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!