Calculate volume encapsuled by two surfaces
Show older comments
Hey guys,
I have following problem: I need to calculate the volume that is encapsuled by two surfaces (see pic). I can sample the surface points since it is represented as an sfit.
I tried to use integral2 like this:
fun1 = @(x,y) my_blue_fit(x,y);
fun2 = @(x,y) my_red_fit(x,y);
vol1 = integral2(fun1, -4, 4, -4, 4);
vol2 = integral2(fin2, -4, 4, -4, 4):
vol_total = vol1 - vol2;
However, this is obviously not correct since I only want the encapsuled volume, and not the integral across the whole FOV.
Can anyone help me to get the integral borders right? Thanks in advance!
(P.s.: The volume has an irregular shape, so it doesn't have a circular footprint or smth like that)

Accepted Answer
More Answers (0)
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!