MATLAB: Calculate volume from an isosurface

isosurfacepatchvolume

Hello,
i have a isosurface like in the picture below generated by the commands isosurface and patch.
How can I calculate the volume enclosed by this surface and the coordinate planes?
Unbenannt.PNG
Thank you for your help in advance.

Best Answer

If your iso surface is get from isosurface() command then your volume is set of voxels
V <= isovalue
or
V >= isovalue
So the volume is approximatively
V = sum(V <= isovalue) * dV % change test sign accordingly
with, for uniform grid
dV = dX*dY*dZ
or
V = sum((V <= isovalue).*dX*dY*dZ)
otherwise